LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2016, 09:15 PM   #1
Mel96
LQ Newbie
 
Registered: Oct 2015
Posts: 13

Rep: Reputation: Disabled
Need to resize (enlarge) a file system.


Hi,

My system is Suse Linux 11 PL4.

I need to enlarge my file system /dev/sdb1.

In my VM I enlarged /dev/sdb from 200GB to 300GB.

I went in to the YAST expert partitioner and tried to resize /dev/sdb1 to the new maximum.

But I got a message that says I need to unmount the file system.

I tried doing this using both Yast and umount but both times got a message that the system was in use.

What is the best way to get this filesystem resized?


I have read about changing the kernel parameters to boot in single user mode. I am a little wary of this because I don't want to end up with a problem booting. If this is the correct approach please provide and example of the change to make.

Thanks for any help.

Mel
 
Old 02-24-2016, 09:38 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,337
Blog Entries: 28

Rep: Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144
I gather that is file system is in a VM. There are two primary steps, and I'm not quite sure in what order they must occur. One is to enlarge the file system. The other is to tell the virtualizer that the file system has been enlarged.

What virtualizer are you using?

This link may help: http://www.howtogeek.com/124622/how-...box-or-vmware/
 
Old 02-24-2016, 10:03 PM   #3
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
But I got a message that says I need to unmount the file system.
You can't resize a partition while the system is up and running.

---* ---* ---* ---* ---* ---* ---*
frankbell:
Would g-parted work in a VM?
 
Old 02-25-2016, 02:55 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,901

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
in that case (partition is in use and you cannot umount) you may need to boot another os (from usb) to make it work. But still unlcear (for me) if that partition is handled by the guest or host os.
 
Old 02-25-2016, 03:08 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
If you have ext4 you can online resize even if mounted. But only once. At least I had this behaviour 2 years ago. Might have changed that you can resize it more often now.

Just like pan64 said. I'm not sure where (vm or host) the filesystem is to be enlarged. What I guess is that the vm resize was okay. But sdb1 in the vm is not sdb1 on the host. You could try to shutdown the VM I and retry.

Booting into single user mode wont help. Due to the filesystem still being mounted. At least if you want to enlarge the root filesystem of the host. In that case boot of a nother os like pan mentioned.

Please give more informationen so we are able to help you better.
 
Old 02-25-2016, 06:55 AM   #6
Mel96
LQ Newbie
 
Registered: Oct 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks everyone for the replies.

The virtualizer is Vmware/VSphere. I used this to enlarge the underlying Virtual Disk. And this worked with no problem.

The expert partitioner now reports the maximum available size as the new size of /dev/sdb (300G).

But the size of /dev/sdb1 is still 200G.

When I use the resize option it gives the error that /dev/sdb1 should be unmounted.

When I try to unmount it says /dev/sdb1 is in use.

So linux can see the enlarged virtual disk but cannot enlarge the filesystem on it.

I suspect this may be because of some of the processes that are automatically starting when the system boots up are using /dev/sdb1.

Is there a way to force linux to boot so that no additional processes are automatically started?

Is the a file somewhere where the startups could be commented out temporarily until I get the filesystem enlarged?

Thanks for any help.

Mel
 
Old 02-25-2016, 07:12 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Run these commands. Use root/sudo as appropriate. Post the output - all of it.
Code:
parted /dev/sdb "print free"
df -hT
 
Old 02-25-2016, 07:13 AM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Personally, sometimes it is better to goto the source to find the answers to your questions.

Last edited by BW-userx; 02-25-2016 at 07:15 AM.
 
Old 02-25-2016, 07:47 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,901

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
the virtual disk is logically enlarged, that means it is physically smaller and VM will try to grow it as needed. Actually it occupies less space on the real disk and VM will not be able to grow it because there is no enough space to do that. So you will not be able to use it as long as the underlying filesystem is not enlarged.
 
Old 02-25-2016, 08:41 AM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Assuming that you're talking ext4 and not using LVM, my view of it is that there are 3 stages involved:

(i) Increase the size of the underlying virtual HDD - you've done this.

(ii) Increase the partition to fill the HDD.

(iii) Increase the filesystem to fill the partition.

The second should be achievable by booting within the VM off a virtual CD with a Gparted Live ISO.

The third can be done by using an online resize2fs once you've rebooted into the system.
 
Old 02-25-2016, 08:49 AM   #11
Mel96
LQ Newbie
 
Registered: Oct 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Hydrurga,

Thanks for the reply. It is going to be difficult to boot off a virtual CD. Is there no way to do this by booting the existing Linux OS differently?

Mel
 
Old 02-25-2016, 08:53 AM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,901

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
Quote:
Originally Posted by Mel96 View Post
Is there no way to do this by booting the existing Linux OS differently?
http://www.linuxquestions.org/questi...2/#post5505917
 
Old 02-25-2016, 08:54 AM   #13
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Mel96 View Post
Hydrurga,

Thanks for the reply. It is going to be difficult to boot off a virtual CD. Is there no way to do this by booting the existing Linux OS differently?

Mel
Out of interest, why is it going to be difficult to boot off a virtual CD?

Surely you did that to install the operating system using the Linux install ISO, no?
 
Old 02-25-2016, 09:18 AM   #14
Mel96
LQ Newbie
 
Registered: Oct 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Yes I can get the ISO with some effort. I can boot into the BIOS if needed.

Of course I can take the machine out of production temporarily if needed.

Still, I am frustrated that there is not a way to do it without that.

I will probably go that route but I would still like to know if there are other options.

Thanks,

Mel
 
Old 02-25-2016, 09:27 AM   #15
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Mel96 View Post
Yes I can get the ISO with some effort. I can boot into the BIOS if needed.

Of course I can take the machine out of production temporarily if needed.

Still, I am frustrated that there is not a way to do it without that.

I will probably go that route but I would still like to know if there are other options.

Thanks,

Mel
You wouldn't have to go anywhere near the BIOS, it's the VM we're talking about. Also, the ISO is a simple download. See here for how to mount the ISO: https://www.petri.com/use-iso-image-files-vmware

I wasn't aware that taking the machine out of production was a problem for you until now. Someone may come up with a way that it can be avoided, but in likelihood it won't. You should be making a complete backup of the VM before you start anyway.

Also, if taking the machine out of production is an important issue for you, then you should do a dry run by setting up a non-production machine and VM and carrying out the steps you are planning to carry out so that you can iron out any potential problems and keep down-time to a minimum.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to resize file system after adding new physical volume keith.turley Linux - Enterprise 7 10-23-2013 02:17 AM
process to resize a redhat cluster file system in linux Chaitu4u Linux - Server 1 07-27-2013 07:45 AM
JFS resize resulted in read-only file-system and failed shutdown -r catkin Linux - General 2 04-26-2011 03:57 AM
Enlarge /boot file system to update kernel Cambren Linux - Newbie 3 10-12-2007 03:31 PM
Resize file system czezz Solaris / OpenSolaris 4 09-20-2007 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration