Growfs: Difference between revisions
From Hackepedia
Jump to navigationJump to search
No edit summary |
m take some erroneous data out. |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Here is a breakdown on how to grow | Here is a breakdown on how to grow an ffs filesystem. | ||
Let's make a big file which will represent our disk, 32MB in size: | Let's make a big file which will represent our disk, 32MB in size: | ||
Line 68: | Line 68: | ||
# cd /tmp | # cd /tmp | ||
# umount /mnt | # umount /mnt | ||
''Note the reason the filesystem Capacity changed from 105% to 104% is because the author had deleted some files and represented this with "...". Don't get confused!'' | |||
Now we grow the partition: | Now we grow the partition: | ||
Line 94: | Line 96: | ||
Conclusions: | Conclusions: | ||
growfs not only increased the data space on the filesystem but also the index (inodes) | growfs not only increased the data space on the filesystem but also the index (inodes). |
Latest revision as of 13:26, 6 February 2010
Here is a breakdown on how to grow an ffs filesystem.
Let's make a big file which will represent our disk, 32MB in size:
# dd if=/dev/zero of=disk bs=32m count=1 1+0 records in 1+0 records out 33554432 bytes transferred in 0.164 secs (204133427 bytes/sec) # vnconfig -cv svnd0 disk svnd0: 33554432 bytes on disk
/dev/svnd0c is now our disk. Create a partition on it, this time we'll make it too small so that there is space left on the disk:
# disklabel -E svnd0 disklabel: Can't get bios geometry: Device not configured Initial label editor (enter '?' for help at any prompt) > a partition: [a] offset: [0] size: [65536] 32768 FS type: [4.2BSD] > p device: /dev/rsvnd0c type: SCSI disk: vnd device label: fictitious bytes/sector: 512 sectors/track: 100 tracks/cylinder: 1 sectors/cylinder: 100 cylinders: 655 total sectors: 65536 free sectors: 32768 rpm: 3600 16 partitions: # size offset fstype [fsize bsize cpg] a: 32768 0 4.2BSD 2048 16384 16 # Cyl 0 - 327* c: 65536 0 unused 0 0 # Cyl 0 - 655* > q Write new label?: [y] y
Write the filesystem on it:
# newfs /dev/rsvnd0a Warning: cylinder groups must have a multiple of 8 cylinders Warning: 32 sector(s) in last cylinder unallocated /dev/rsvnd0a: 32768 sectors in 328 cylinders of 1 tracks, 100 sectors 16.0MB in 1 cyl groups (328 c/g, 16.02MB/g, 2048 i/g) super-block backups (for fsck -b #) at: 32,
Mount the filesystem and populate it with files:
# mount /dev/svnd0a /mnt # cd /mnt # cp /bin/* . # cp /sbin/* . /mnt: write failed, file system is full ... # df . Filesystem 512-blocks Used Avail Capacity Mounted on /dev/svnd0a 32156 31992 -1440 105% /mnt ... # df -i . Filesystem 512-blocks Used Avail Capacity iused ifree %iused Mounted on /dev/svnd0a 32156 31740 -1188 104% 134 1912 7% /mnt # cd /tmp # umount /mnt
Note the reason the filesystem Capacity changed from 105% to 104% is because the author had deleted some files and represented this with "...". Don't get confused!
Now we grow the partition:
# disklabel -e svnd0 # growfs /dev/rsvnd0a We strongly recommend you make a backup before growing the Filesystem Did you backup your data (Yes/No) ? Yes new file system size is: 16384 frags growfs: 65536 sectors in 656 cylinders of 1 tracks, 100 sectors 32.0MB in 2 cyl groups (328 c/g, 16.02MB/g, 2048 i/g) superblock backups (for fsck -b #) at: 32832
Mount it and check it:
# mount /dev/svnd0a /mnt # cd /mnt # df . Filesystem 512-blocks Used Avail Capacity Mounted on /dev/svnd0a 64348 31740 29392 52% /mnt # df -i . Filesystem 512-blocks Used Avail Capacity iused ifree %iused Mounted on /dev/svnd0a 64348 31740 29392 52% 134 3960 3% /mnt
Conclusions:
growfs not only increased the data space on the filesystem but also the index (inodes).