How to create a secondary partition?

Hi all! I have some free space storage available and now I want to use it creating a secondary partition in order to be able to mount it.

my current stats (from linode manager):

Storage Stats

32768 MB

Allocated

8192 MB

Free

40960 MB

Total

How should I perform this operation? I know how to mount it, etc, but I'm not so sure if I have to use fdisk in this case or what because I'm getting 'doesn't contain a valid partition table':

Disk /dev/xvdb: 272 MB, 272629760 bytes

255 heads, 63 sectors/track, 33 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/xvdb doesn't contain a valid partition table

TIA!

8 Replies

There are no partitions, only disk images mounted as partitionless devices. What you want to do is create a new disk image through the linode manager, and then edit your configuration profile to assign the disk image to a device (probably xvdc, unless you have no swap). Then modify your fstab to mount the new image.

One more doubt, if I go to my linode > Edit Disk Image, there's an option to define a 'New Size'.

Can I safely resize my active disk image (running CentOS) to a smaller number?, of course not lower than the free space I have inside the VM/partition; If yes, do I have to previously shutdown the VM?

What I'm trying to achieve is to append the current free space available (8192MB) to this other one (after the resizing) in order to create a new bigger disk image/secondary partion of around 15GB.

TIA

You can shrink your disks but the node has to be shutdown first.

So you want two disk images with some free space taken from the primary image? If so shutdown your node, resize the existing disk, then create a new disk, update your configuration profile and boot.

Yes, that's what I want to do, so I can assume that it's a safe operation (if properly done of course).

Thanks!

Think of it a bit like VMWare workstation, if you've ever used that ;)

@Guspaz:

What you want to do is create a new disk image through the linode manager, and then edit your configuration profile to assign the disk image to a device (probably xvdc, unless you have no swap). Then modify your fstab to mount the new image.

Wish I found this nugget 2-3 hours ago ;-)

If you're wondering how to "modify fstab" check this link -

http://www.linode.com/wiki/index.php/Fstab

So edit fstab, reboot, run "fdisk -l" and hooray,

Disk /dev/xvdc: 16.7 GB, 16743661568 bytes

255 heads, 63 sectors/track, 2035 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

And then, hopefully:

Disk /dev/xvdc doesn't contain a valid partition table

This was covered above, but it's worth mentioning for the future scroll-to-the-bottom crowd: /dev/xvd* do not have partition tables, for the same reason that /dev/sda1 wouldn't have a partition table. Keep fdisk very far away.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct