[Starcluster] enlarge volume
Austin Godber
godber at uberhip.com
Thu Aug 12 20:31:04 EDT 2010
Alright, I have it running, here's the short version, commands only, no
output, run as root, disk is attached at /dev/sdf with one partition:
Check the filesystem (might want to use -f to force a real check)
# fsck /dev/sdf1
Repartition with sfdisk, start at the first cylinder end at the last
# echo ",,L" | sfdisk /dev/sdf
Resize the ext3 filesystem
# resize2fs /dev/sdf1
Recheck the filesystem
# fsck -f /dev/sdf1
Now mount and check that the data is there and the size is correct with
df -h.
Let me know if it works for you.
- Austin
Here is my verbose version, with output.
# fsck /dev/sdf1
fsck from util-linux-ng 2.16
e2fsck 1.41.9 (22-Aug-2009)
/dev/sdf1: clean, 11/196608 files, 29901/785176 blocks
# sfdisk -l /dev/sdf
Disk /dev/sdf: 652 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdf1 0+ 390 391- 3140707 83 Linux
/dev/sdf2 0 - 0 0 0 Empty
/dev/sdf3 0 - 0 0 0 Empty
/dev/sdf4 0 - 0 0 0 Empty
# echo ",,L" | sfdisk /dev/sdf
Checking that no-one is using this disk right now ...
OK
Disk /dev/sdf: 652 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdf1 0+ 390 391- 3140707 83 Linux
/dev/sdf2 0 - 0 0 0 Empty
/dev/sdf3 0 - 0 0 0 Empty
/dev/sdf4 0 - 0 0 0 Empty
New situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdf1 0+ 651 652- 5237189+ 83 Linux
/dev/sdf2 0 - 0 0 0 Empty
/dev/sdf3 0 - 0 0 0 Empty
/dev/sdf4 0 - 0 0 0 Empty
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Successfully wrote the new partition table
Re-reading the partition table ...
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
# resize2fs /dev/sdf1
resize2fs 1.41.9 (22-Aug-2009)
Resizing the filesystem on /dev/sdf1 to 1309297 (4k) blocks.
The filesystem on /dev/sdf1 is now 1309297 blocks long.
# fsck -f /dev/sdf1
fsck from util-linux-ng 2.16
e2fsck 1.41.9 (22-Aug-2009)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdf1: 11/327680 files (0.0% non-contiguous), 38511/1309297 blocks
On 08/12/2010 08:01 PM, Dan Yamins wrote:
> Let me add one more thing to this thread:
>
> Even on ubuntu, even with my original volume, you can't do "e2fsck" of
> the "device" , e.g.
>
> $ e2fsck /dev/sdz
> Couldn't find ext2 superblock, trying backup blocks...
> e2fsck: Bad magic number in super-block while trying to open /dev/sdo
> ...
>
> Is that to be expected? In a number of tutorials on resizing EBS
> volumes, i have seen this done with the devices itself. Is the reason
> this is failing because its a partitioned drive?
>
>
>
> On Thu, Aug 12, 2010 at 6:43 PM, Dan Yamins <dyamins at gmail.com
> <mailto:dyamins at gmail.com>> wrote:
>
>
>>> Do you have a snapshot? I have used parted and
>>> e2resizefs to expand an ext3 filesystem without trouble.
>>>
>>>
>
>
> So I'm trying parted on a new, clean volume created from the
> snapshot, attached to /dev/sdm As I explained before, I can't do
>
> $ parted /dev/sdm
> [root at domU-12-31-39-0E-B2-61 ~]# parted /dev/sdm
> Error: Error initialising SCSI device /dev/sdm - Invalid argument
>
> AUstin, when you did this did you get that same error?
>
>
> I /CAN/ do parted on the path:
>
> $ parted /dev/sdm1
> GNU Parted 1.8.1
> Using /dev/sdm1
> Welcome to GNU Parted! Type 'help' to view a list of commands.
>
> But then i get this error:
>
> (parted) resize 1 0 500GB
> Error: The location 500GB is outside of the device /dev/sdo1.
>
> Which is course is true ...
>
> (parted) print
> Disk /dev/sdm1: 21.5GB
> Sector size (logical/physical): 512B/512B
> Partition Table: loop
>
> Number Start End Size File system Flags
> 1 0.00kB 21.5GB 21.5GB ext3
>
>
> So I'm not sure where to go from here...
>
> Dan
>
>
>
> _______________________________________________
> Starcluster mailing list
> Starcluster at mit.edu
> http://mailman.mit.edu/mailman/listinfo/starcluster
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/starcluster/attachments/20100812/ebf5e2ca/attachment.htm
More information about the StarCluster
mailing list