LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-25-2019, 05:18 PM   #1
spaghettios
LQ Newbie
 
Registered: Jul 2012
Location: UK
Distribution: Ubuntu, Slackware
Posts: 28

Rep: Reputation: Disabled
help understanding filesystem, partitions and mounting


Hi,

I have installed slackware onto a T61 with a single 250GB SSD. I did this some months ago and haven't picked it up since. I am getting an error message saying /home is full, and it appears everything is on one partition. I've tried to read around this a little, but would appreciate any help with reconciling the below:

My cfdisk reads:
Code:
 
    /dev/sda1                 2048   16779263   16777216      8G  82 Linux swap 
    /dev/sda2    *        16779264   58722303   41943040     20G  83 Linux
    /dev/sda3             58722304  488397167  429674864  204.9G  83 Linux
On install i set the swap to twice the RAM and then allocated 20GB for the slackware install - which i assumed would be sufficient. When i run the df command i get:
Code:
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       9.8G  9.0G  237M  98% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G  972K  1.9G   1% /run
tmpfs           1.9G   63M  1.9G   4% /dev/shm
cgroup_root     1.9G     0  1.9G   0% /sys/fs/cgroup
cgmfs           100K     0  100K   0% /run/cgmanager/fs
So question 1 is were's my 20G? i see 18GB spread across all of these. My understanding from FHS is that i should have mounted /home, /tmp, /usr, /opt and /var to a separate partition (question 2 - all on a single separate one?) Finally, when i look in the fstab file i see:

/
Code:
dev/sda1        swap             swap        defaults         0   0
/dev/sda2        /                ext4        defaults         1   1
/dev/sda3        /home            ext4        defaults         1   2
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
which i read as saying sda3 is mounted to /home? From the cfdisk that suggested that sda3 wasn't mounted at all?

Is there a way i can mount the relevant directories to another partition away from the / filesystem, without having to do a total reinstall?
 
Old 12-25-2019, 08:35 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: 16,752
Blog Entries: 27

Rep: Reputation: 5082Reputation: 5082Reputation: 5082Reputation: 5082Reputation: 5082Reputation: 5082Reputation: 5082Reputation: 5082Reputation: 5082Reputation: 5082Reputation: 5082
Quote:
Is there a way i can mount the relevant directories to another partition away from the / filesystem, without having to do a total reinstall?
What do you mean by "relevant directories"?

Traditionally, in measuring hard drive space, a kilobyte is 1000 bytes, whereas in measuring file size, a kilobyte is 1024 bytes. There is no good reason for this, other than that way back in the early days of computing, it just happened.

That discrepancy probably accounts for the 18 vs. 20 GB figures you cite.

Other than that, I see nothing out of order in you partitioning. In fact, it's wise to put /home on a separate partition from root. In that way, if you must reinstall, the data in your root directory can be preserved.
 
Old 12-25-2019, 09:23 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,242

Rep: Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382
Quote:
Originally Posted by spaghettios View Post
So question 1 is were's my 20G? i see 18GB spread across all of these.
Nope - everything other than the root are pseudo filesystems; that means they don't exist on disk. df shows the size of the filesystem - implies that the partition was expanded after the mkfs, or the filesystem was copied as-is from somewhere else.
Quote:
which i read as saying sda3 is mounted to /home? From the cfdisk that suggested that sda3 wasn't mounted at all?
Certainly looks that way - what do the logs have to say about that ?
 
Old 12-25-2019, 09:46 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 20,638

Rep: Reputation: 3650Reputation: 3650Reputation: 3650Reputation: 3650Reputation: 3650Reputation: 3650Reputation: 3650Reputation: 3650Reputation: 3650Reputation: 3650Reputation: 3650
As stated hard drives sizes from the manufacture as 1000 bytes but operating system uses 1024 bytes. Your 250 GB drive is actually 232 GB as shown if you total the partition sizes from the output of the cfdisk command.

The partition is just a container for the filesystem and usually when a filesystem is created it will automatically be sized the same as the partition by default. However, from the information provided the filesystem for whatever reason is only 10 not 20GB. I would try resizing your / partition and see what happens. Be sure to create a backup of any and all important data first. As I understand it is possible to resize an ext4 system online. I'm not that adventurous and boot a live version since you can't unmount a / filesystem.

Why your /home partition is not automatically being mounted is the next question. Make sure /dev/sda3 contains an actual filesystem and if so you can mount it to a temp directory, copy the home directories/files to the temp directory, delete the contents of /home on sda1 and reboot.

While you can have separate partitions for the posted directories it does make things more complicated. I usually just stick to the basics of /, /home and swap.
 
Old 12-26-2019, 01:42 AM   #5
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 2,780
Blog Entries: 1

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
My assessment most closely matches what michaelk wrote. I'd live boot something that sees those partitions with the same names sda1-3, keep them unmounted, then run e2fsck on both in turn sda2 and sda3. Once satisfied sda2 is OK, I'd run resize2fs on it, which I'd expect to bring it up in size to using the whole of sda2. Assuming that succeeds, next I'd try a normal boot, and on first login (as root), do df again to see if freespace on / doubled and sda3 got mounted to /home as fstab says it should.

Does output from fdisk -l and parted -l match that from cfdisk?
 
Old 12-26-2019, 10:19 AM   #6
spaghettios
LQ Newbie
 
Registered: Jul 2012
Location: UK
Distribution: Ubuntu, Slackware
Posts: 28

Original Poster
Rep: Reputation: Disabled
Thanks all, the resize2fs sorted out the disk space on sda2.

df -l now returns:
Code:
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root       20511356 9420064  10110228  49% /
devtmpfs         1978120       0   1978120   0% /dev
tmpfs            1980344     984   1979360   1% /run
tmpfs            1980344  165688   1814656   9% /dev/shm
cgroup_root      1980344       0   1980344   0% /sys/fs/cgroup
cgmfs                100       0       100   0% /run/cgmanager/fs
cfdisk
Code:
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048  16779263  16777216     8G 82 Linux swap
/dev/sda2  *     16779264  58722303  41943040    20G 83 Linux
/dev/sda3        58722304 100665343  41943040    20G 83 Linux
/dev/sda4       100665344 488397167 387731824 184.9G 83 Linux
I still need to move /home and possibly /opt to another partition so have created 2 new partitions, the old sda3 wasn't formatted either which probably caused problems. /opt to go on sda3 and /home on sda4. In the process of the move i am a bit confused by the order of steps. According to this walkthrough
  1. i create a new directory (on /srv/home),
  2. mount sda4 to the new /srv/home directory [i am not sure this is the correct usage],
  3. copy the /home directory from /home to /srv/home then make sure they're the same,
  4. delete the old /home,
  5. unmount /srv/home,
  6. mount sda4 to /home
...then update fstab

I follow that roughly to the last two steps: once we unmount /srv/home nothing is mounted, then in the last step we mount sda4 to /home ....but didn't i delete /home in step 4?

Thanks so far for your help!
 
1 members found this post helpful.
Old 12-26-2019, 12:30 PM   #7
spaghettios
LQ Newbie
 
Registered: Jul 2012
Location: UK
Distribution: Ubuntu, Slackware
Posts: 28

Original Poster
Rep: Reputation: Disabled
well that didn't go terribly from what i can tell.

There were a few issues at the rsync / copy and delete stage for moving /home as some files couldn't be accessed. Not sure if that will cause further issues later on, certainly not as clean as could be. Firefox was the only application in /opt, for some reason i now have 3 quick launch icons for Konqueror. When i went to update fstab i didn't use the UUID as recommended but just entered the device names through nano, which didn't seem very scientific.

df -hl
Code:
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        20G  8.1G   11G  44% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G  976K  1.9G   1% /run
tmpfs           1.9G   33M  1.9G   2% /dev/shm
cgroup_root     1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda3        20G  242M   19G   2% /opt
/dev/sda4       182G  962M  172G   1% /home
cgmfs           100K     0  100K   0% /run/cgmanager/fs
parted -l
Code:
Model: ATA CT250MX500SSD1 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  8591MB  8590MB  primary  linux-swap(v1)
 2      8591MB  30.1GB  21.5GB  primary  ext4            boot
 3      30.1GB  51.5GB  21.5GB  primary  ext4
 4      51.5GB  250GB   199GB   primary  ext4
Thanks again!
 
1 members found this post helpful.
  


Reply

Tags
fdisk, filesystem, mount, partition


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
[SOLVED] Help with understanding the 'with' keyword and understanding file reading and writing. vysero Programming 3 05-30-2018 03:37 PM
Difference between Readonly Filesystem and Mounting filesystem as readonly bluepenguine Linux - Newbie 1 06-19-2009 02:26 AM
Help please for, setting up/understanding Partitions flatstan Linux - Newbie 3 08-13-2006 07:02 AM
Create software RAID partitions first, then create filesystem partitions on top of th stefanlasiewski Linux - Software 1 04-28-2004 05:12 PM
Partitions, partitions, partitions..... Clueless in VA Linux - Newbie 7 08-08-2001 04:01 AM

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

All times are GMT -5. The time now is 05:07 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