LinuxQuestions.org
Visit Jeremy's Blog.
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 06-24-2013, 01:35 PM   #1
Froggy192
LQ Newbie
 
Registered: Jun 2013
Distribution: Windows 8, Mint 15
Posts: 12

Rep: Reputation: 0
Add a parition after install.


It looks like I made my / partition a bit small and now it's running out of space. I looked a bit, and the /usr filesystem seems to be the the big space eater. So, how could I move /usr to a new partition not to clutter up / ?

I'm on Linux Mint 15.
 
Old 06-24-2013, 01:37 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,204

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
What is the output of mount?
 
Old 06-24-2013, 01:42 PM   #3
itsgregman
Member
 
Registered: Jan 2008
Location: North Carolina
Distribution: Slackware 14.1
Posts: 199

Rep: Reputation: 59
In terminal run

fdisk -l

post results
 
Old 06-24-2013, 01:52 PM   #4
Froggy192
LQ Newbie
 
Registered: Jun 2013
Distribution: Windows 8, Mint 15
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Number Start (sector) End (sector) Size Code Name
1 2048 821247 400.0 MiB 2700 Basic data partition
2 821248 1435647 300.0 MiB EF00 EFI system partition
3 1435648 1697791 128.0 MiB 0C01 Microsoft reserved part
4 1697792 253356031 120.0 GiB 0700 Basic data partition
5 253356032 254820351 715.0 MiB EF00
6 254820352 255307775 238.0 MiB 0700
7 255307776 315308031 28.6 GiB 0700
8 315308032 415307775 47.7 GiB 0700
9 415307776 425308159 4.8 GiB 8200
12 1914701824 1953523711 18.5 GiB 2700 Basic data partition
fdisk gave an error, since I've got GPT. That's the output of gdisk and typing print.
 
Old 06-24-2013, 01:55 PM   #5
Froggy192
LQ Newbie
 
Registered: Jun 2013
Distribution: Windows 8, Mint 15
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
/dev/sda7 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /sys/firmware/efi/efivars type efivarfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
/dev/sda6 on /boot type ext2 (rw)
/dev/sda8 on /home type ext4 (rw)
/dev/sda2 on /boot/efi type vfat (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfsd-fuse on /run/user/optimus/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=optimus)
This is the output of mount.
 
Old 06-24-2013, 04:01 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
I think the simplest option is to reboot to Mint's liveCD and work with that.

Open gparted and view your disk partitions

do you have a partition in mind for /usr ?
assuming you do,right click that partition and select information
You want to look for the UUID
this will be a long string in the format
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
where x is an alphanumeric
Note this string will change if you format the partition

Mount both the root partition and your intended usr partition
( you should see Hard Drive icons in the 'My Computer' section of the file manger or desktop. )

Open a terminal and :
Code:
df -h
identify where root and your new usr are mounted
Code:
cp -a /path/to/root/usr/* /path/to/usr/
-a will preserve the files attributes

Now find the /etc/fstab on your root partition and edit it

assuming it looks something like this
Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /     ext4 defaults 0 1
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /home ext4 defaults 0 2
You want to add ( above /home and below / , but order is for you not linux )
Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /     ext4 defaults 0 1
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /usr  ext4 defaults 0 2
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /home ext4 defaults 0 3
Obviously using the UUID for usr you copied earlier.
Assumes /usr is ext4, substitute with appropriate fs.
The last number is the order to run fsck when booting.


Now when you reboot /usr should be the new partition
check with
Code:
df -h
assuming things are working OK, Go back to the Live CD and delete the files in the root partition's /usr directory
Code:
rm -rf /path/to/root/usr/*
^^^^^^^ Careful with that!11oneeleven


If you wanted, you could go direct and use mv instead of cp -a, reboot, check , reboot, rm.
Much quicker and to be honest the risk involved is low

You could do all this on the running system, but as files in usr will almost certainly be in use you would need to drop to a single user mode. You may like to read up on that for future reference.
 
1 members found this post helpful.
Old 06-24-2013, 04:18 PM   #7
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
Looking back, I notice your root is 28G ?
this should be plenty, you might want to look a little further into what is using the space

I find ncdu to be great for this

Code:
sudo apt-get install ncdu
then
Code:
ncdu -x /
I find it works faster than the graphical 'disk use' analysers you get with Ubuntu and the like.
 
1 members found this post helpful.
Old 06-24-2013, 05:41 PM   #8
Froggy192
LQ Newbie
 
Registered: Jun 2013
Distribution: Windows 8, Mint 15
Posts: 12

Original Poster
Rep: Reputation: 0
Thank's a lot for the helpful reply, Firerat! I'll try the your suggestion and see how it goes. Also, ncdu also showed /usr as taking up the most space.

And all the usage is probably from the games I installed so far. /usr is where they all go, right?
 
Old 06-24-2013, 06:13 PM   #9
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
yes, probably the games

with ncdu you can navigate with up/down arrows and <enter>
so you can see the usage within each directory.

It might make sense to have a separate partition for a subdir of /usr instead of all of it

if it is /usr/games that is using most of the space, then you can probably skip the Live CD method by making sure those games are not in use.

example assuming /usr/games is the culprit and /dev/sda12 is intended extra partition

Code:
sudo mount /dev/sda12 /mnt
sudo mv -v /usr/games/* /mnt/
Then edit /etc/fstab with your preferred editor
Note, you can also find the UUID with
Code:
ls -l /dev/disk/by-uuid/
then
Code:
sudo umount /mnt
sudo mount /usr/games
ultimately this would give you more efficient use of the space available

Last edited by Firerat; 06-24-2013 at 06:21 PM. Reason: forgot to unmount
 
Old 06-24-2013, 06:34 PM   #10
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
oh, and for the future consider LVM
https://en.wikipedia.org/wiki/Logica...er_%28Linux%29

which offers greater flexibility over traditional partitioning.

or if you want to live life on the edge
https://en.wikipedia.org/wiki/Btrfs

and zfs is worth a look
https://en.wikipedia.org/wiki/ZFS
 
Old 06-25-2013, 09:08 PM   #11
Froggy192
LQ Newbie
 
Registered: Jun 2013
Distribution: Windows 8, Mint 15
Posts: 12

Original Poster
Rep: Reputation: 0
I got it working without problems. I just followed Firerat's suggestions and now I've got /usr on a new partition! Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Howto - Parition. Kernel install/upgrade. Looking for pointers. jmut Slackware - Installation 2 06-05-2006 08:06 PM
New Parition on existing install chow-stl Slackware - Installation 5 06-28-2005 06:10 AM
Linux Parition Install Windows DaveyB Linux - Software 9 09-09-2004 09:19 AM
Parition resizing compu73rg33k Linux - Software 6 08-21-2004 04:34 PM
when install additional distros, can they all share same parition? (other then root) sirpelidor Linux - Newbie 2 05-02-2004 01:51 PM


All times are GMT -5. The time now is 09:55 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration