Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all
I meet the following problem, don’t sucess to enlarge this fuc** space disk. I explain
This CentOS VM is running under Azure, and I expanded correctly the system hard disk from 30GB to 550GB, OK. When I check on fdisk, I see there is correctly 550GB available
Disk /dev/sda: 549.8 GB, 549755813888 bytes
255 heads, 63 sectors/track, 66837 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c23d3
But now, how to enlarge this partition withot having the need to shutdown the VM ? I tried different tools like vlextends etc.. but without any success. So please if you could give me the command line to enlarge this system hard disk from 30 to 550GB, I would reaaaaly appreciate !!
Now you are new here, so we best be lenient, and lack of knowledge may lead to frustration but still there's no reason for that.
Quote:
Originally Posted by percoclap23
When I check on fdisk, I see there is correctly 550GB available
Disk /dev/sda: 549.8 GB, 549755813888 bytes
Your partial output doesn't include a partition table (if any) so there is no way to know, and therefore to advise, the right approach. You do seem to hint at using LVM but do understand that posting full tool output (fdisk -l /dev/sda; pvdisplay; vgdisplay; lvdisplay; dmsetup status; and such) is the best, unambiguous way to present nfo.
Quote:
Originally Posted by percoclap23
how to enlarge this partition withot having the need to shutdown the VM ? I tried different tools like vlextends etc.. but without any success.
Why not run us through the steps you took and post command used and the (error?) output those commands returned?
You can research this, with a search like: resize2fs root partition
Others get 'stuck' on this, until they become aware of this concept, so don't feel bad!
The 1st in "Similar Threads" (below, bottom) eventually gets to this keyword/command in #10
also, when you first post a new Thread, under the Title, is a "Click Here to Find Similar Threads" button.
A couple more notes: you can edit your original post, to remove that ...** offensive word;
if your problem is resolved, you can use "Thread Tools" at top to mark [SOLVED];
if you find a post (reply) especially helpful, you can click on "Yes" in lower right corner.
Sorry for suggesting the 'obvious' that you had already tried.
Another idea (tho it may again be [ditto]):
Did you reboot? Try `partprobe` (or 'w' in fdisk), to make the kernel re-read the partition table.
(I think fdisk can 'see' what the kernel is *not*! [yet] 'aware' of; I've seen this before!)
p.s.
Specific detail question: did you [*ever*] use the fdisk 'w', to update ..., OR did you just do the Azure-size-increase, then [*only*] *look* at fdisk -l? (I'm only asking this detail, to understand/learn what might have happened, not to be 'picky') Thanks!
Last edited by Jjanel; 10-23-2016 at 07:19 PM.
Reason: p.s. ?
I hope that you had the foresight to include LVM = Logical Volume Management when you constructed this Linux system, because if you did, the solution to your difficulty is very easy.
LVM allows you to associate physical volumes (disk drives) with "storage pools," and then to associate those storage pools with "mount points" (such as, say, /usr), so that this mount-point is now associated with multiple drives and the data is spread-out among them. You can add new storage without even rebooting the system. If a drive is "going flaky on you," you can migrate it out-of-service and bring in a new one ... again, without rebooting the system.
Hi all, thanks for all your feedback, lets try to move forward
Quote:
Originally Posted by Jjanel
Sorry for suggesting the 'obvious' that you had already tried.
Another idea (tho it may again be [ditto]):
Did you reboot? Try `partprobe` (or 'w' in fdisk), to make the kernel re-read the partition table.
(I think fdisk can 'see' what the kernel is *not*! [yet] 'aware' of; I've seen this before!)
p.s.
Specific detail question: did you [*ever*] use the fdisk 'w', to update ..., OR did you just do the Azure-size-increase, then [*only*] *look* at fdisk -l? (I'm only asking this detail, to understand/learn what might have happened, not to be 'picky') Thanks!
Yes I already tries fdisk w, and tried to reboot the system.
When I do a partprobe I got the following output :
[root@hcpvm0 ~]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdb (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
[root@hcpvm0 ~]# sudo resize2fs /dev/sda1
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 7608064 blocks long. Nothing to do!
But when I do fdisk-l it says 30427078 block are available...any idea ?!
Different blocksize - the filesystem uses 4k whilst the fdisk display uses 1k.
Looks like you need to resize the partition to the full size of the disk, then rerun the resize2fs. The only way I know to do this automatically is to boot a gparted liveimage in the guest. Else you will have to delete the partition, reallocate it (make sure the start is the same) and then resize2fs.
Repeating the mantra to "use LVM, or switch to it ..." It really is a dangerous thing to "re-size a partition," IMHO. It's terribly easy to fsck things up.
Far better would be to use LVM. Now, you can simply allocate a new partition, add it to the physical pool, then assign that volume to the logical pool that represents the root-directory. Now, you can easily format the new partition and resize the filesystem to encompass the newly added space.
Linux sees the logical view, not (directly) the physical one. The space is now distributed among two (or more) partitions on one (or more) physical disks. But now, the situation is manageable.
Let's say that one of those drives "starts making ominous clicking sounds." You can use LVM to move the physical storage pool from this (failing) drive to a new one, then remove the old drive from service. And you won't have to reboot the machine to do it.
You can also use LVM to distribute traffic among multiple physical volumes and channels just for efficiency's sake. It is extremely powerful to be able to separate the logical view (as seen by application programs) from the physical reality.
I'm pretty much saying that "LVM is the 'right way to do this.'" And the good news is, "it just works.™"
Last edited by sundialsvcs; 11-02-2016 at 09:45 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.