Linux partitioning Watch

AdampskiB
Badges: 2
Rep:
?
#1
Report Thread starter 5 years ago
#1
By looking at the below output by the lsblk command, it generates the current layout of my partitions. My only query is basically, can someone confirm I've done it correctly?

My confirming, I'd like you to check whether I've delegated the correct capacity and locations for my intentions to keep the swap, boot code and OS files on my 24GB SSD, and the rest (program files, personal files, accounts etc) all on my 500GB HDD?

Code:
NAME                  MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                     8:0    0 465.8G  0 disk  
└─sda1                  8:1    0 465.8G  0 part  /
sdb                     8:16   0  22.4G  0 disk  
├─sdb1                  8:17   0   3.8G  0 part  
│ └─cryptswap1 (dm-0) 252:0    0   3.8G  0 crypt [SWAP]
├─sdb2                  8:18   0    95M  0 part  /boot/efi
└─sdb3                  8:19   0  18.5G  0 part  /boot
0
reply
mikeyd85
Badges: 17
Rep:
?
#2
Report 5 years ago
#2
Looks OK to me (though I'm not the foremost Linux user here by a long stretch), but it does make sense, so long as you don't need a swap file > 3.8GB (I don't know what you're using this for!).

What I would say though is would it not make sense to switch the drives over, so that your boot drive is sda and you storage drive is sdb?
0
reply
AdampskiB
Badges: 2
Rep:
?
#3
Report Thread starter 5 years ago
#3
(Original post by mikeyd85)
Looks OK to me (though I'm not the foremost Linux user here by a long stretch), but it does make sense, so long as you don't need a swap file > 3.8GB (I don't know what you're using this for!).

What I would say though is would it not make sense to switch the drives over, so that your boot drive is sda and you storage drive is sdb?
Thanks for your reply!

sdb is SSD, so no I don't believe it would be beneficial to do it the other way round. I also have near 4gb of swap because for uni I'm programming quite a bit, and in case I ever need extra room for when I program terribly, I have it there.
0
reply
mikeyd85
Badges: 17
Rep:
?
#4
Report 5 years ago
#4
(Original post by AdampskiB)
Thanks for your reply!

sdb is SSD, so no I don't believe it would be beneficial to do it the other way round. I also have near 4gb of swap because for uni I'm programming quite a bit, and in case I ever need extra room for when I program terribly, I have it there.
No worries.

Fair enough, I've just always liked my boot device to be labelled as sda / HDD0 / whatever is first. It just feels nice.
Yeah, fair enough on the coding side of things. This is why I didn't want to presume you'd never need 4GB swap. You can never guess why people go to linux, such is it's versatility!
0
reply
mfaxford
Badges: 1
Rep:
?
#5
Report 5 years ago
#5
(Original post by AdampskiB)
By looking at the below output by the lsblk command, it generates the current layout of my partitions. My only query is basically, can someone confirm I've done it correctly?

My confirming, I'd like you to check whether I've delegated the correct capacity and locations for my intentions to keep the swap, boot code and OS files on my 24GB SSD, and the rest (program files, personal files, accounts etc) all on my 500GB HDD?

Code:
NAME                  MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                     8:0    0 465.8G  0 disk  
└─sda1                  8:1    0 465.8G  0 part  /
sdb                     8:16   0  22.4G  0 disk  
├─sdb1                  8:17   0   3.8G  0 part  
│ └─cryptswap1 (dm-0) 252:0    0   3.8G  0 crypt [SWAP]
├─sdb2                  8:18   0    95M  0 part  /boot/efi
└─sdb3                  8:19   0  18.5G  0 part  /boot

/boot doesn't need to be anywhere near that size, I usually make it around 500MB and that's generous. looking at one of my machines it's only using 86Mb in /boot. Unless you're doing raid/ lvm/ encrypted root you might not even need a /boot. Most of the OS lives in /bin, /sbin and /usr, with config data in /etc. Generally these should all be on the same partition unless you really know what you're doing.

You might want to create a /home which is where you're personal stuff is going to live. That way when you upgrade you can format the system partitions and not lose your personal data.

If SDB is the ssd I'd personally physically swap the drives around (or change the BIOS) so that the ssd appears as sda if that's where you're the OS, otherwise you might have slightly odd things happen.

In terms of swap the standard used to be between 1x and 2x physical ram size although these days with a decent amount of ram you probably don't need swap at all. On some systems (usually the real Unix's like Solaris) you should have a swap partition that's at least the same size as your memory as it gets used as a dump space if the OS dies, At present I don't think any Linux system does this. As you shouldn't need to use swap I'd probably put it on the hard disk rather than SSD (

Personally I tend to split out /tmp and /var into separate partitions as well but I use Linux more for servers than desktops,

I'm not really sure how I'd split use between the SSD and standard HDD. In most cases putting the OS on the SSD seems like a waste (most applications aren't that big and Linux is good at caching stuff from disk). If you're working on big projects and in particular software that needs compiling (or things like matlab that use large data sets on disk) then those things might be better off on the SSD.
1
reply
AdampskiB
Badges: 2
Rep:
?
#6
Report Thread starter 5 years ago
#6
(Original post by mfaxford)
/boot doesn't need to be anywhere near that size, I usually make it around 500MB and that's generous. looking at one of my machines it's only using 86Mb in /boot. Unless you're doing raid/ lvm/ encrypted root you might not even need a /boot. Most of the OS lives in /bin, /sbin and /usr, with config data in /etc. Generally these should all be on the same partition unless you really know what you're doing.

You might want to create a /home which is where you're personal stuff is going to live. That way when you upgrade you can format the system partitions and not lose your personal data.

If SDB is the ssd I'd personally physically swap the drives around (or change the BIOS) so that the ssd appears as sda if that's where you're the OS, otherwise you might have slightly odd things happen.

In terms of swap the standard used to be between 1x and 2x physical ram size although these days with a decent amount of ram you probably don't need swap at all. On some systems (usually the real Unix's like Solaris) you should have a swap partition that's at least the same size as your memory as it gets used as a dump space if the OS dies, At present I don't think any Linux system does this. As you shouldn't need to use swap I'd probably put it on the hard disk rather than SSD (

Personally I tend to split out /tmp and /var into separate partitions as well but I use Linux more for servers than desktops,

I'm not really sure how I'd split use between the SSD and standard HDD. In most cases putting the OS on the SSD seems like a waste (most applications aren't that big and Linux is good at caching stuff from disk). If you're working on big projects and in particular software that needs compiling (or things like matlab that use large data sets on disk) then those things might be better off on the SSD.
Great content. Thank you! Exactly what I was after, someone with first hand experience.

I did read that splitting /tmp, /var/, /mail and /usr can be beneficial but predominately only for servers. My current memory capacity is 4gb, so I followed your suggestion and mimicked the swap to my RAM - I wasn't aware it was mainly used for Solaris.

At the time of installation I wasn't sure how much disk space it required, so I hazarded a guess and chucked in 20gb. I do however, have my home folder encrypted.

But for the current standing of the way things are, I'm OK, right?
0
reply
mfaxford
Badges: 1
Rep:
?
#7
Report 5 years ago
#7
(Original post by AdampskiB)
Great content. Thank you! Exactly what I was after, someone with first hand experience.

I did read that splitting /tmp, /var/, /mail and /usr can be beneficial but predominately only for servers. My current memory capacity is 4gb, so I followed your suggestion and mimicked the swap to my RAM - I wasn't aware it was mainly used for Solaris.
/mail would be unusual unless you've configured a mail server to use that for storing email (The standard location on most email servers I've seen is under /var/spool and/or the users home folder). Swap is used on all unix systems but some such as Solaris have particular requirements, Linux I think you can make it any size you want. Generally I wouldn't put /usr on a separate partition as things may not work quite as expected (it was of more benefit in the earlier Unix days where / might have been on a small local drive and /usr was on a network drive. This way there was enough on the local drive to boot up and mount the network drive where most software stored.)

(Original post by AdampskiB)
At the time of installation I wasn't sure how much disk space it required, so I hazarded a guess and chucked in 20gb. I do however, have my home folder encrypted.

But for the current standing of the way things are, I'm OK, right?
If the system is partitioned in the same way as you're original post then you're wasting the SSD. Almost nothing gets stored in /boot and it's only used in the initial parts of the boot process.

I tend to use "df -lh" to see how partitions are being used a couple of examples of my systems are:
Code:
[[email protected] ~]$ df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1             3.9G  1.8G  2.0G  47% /
/dev/hda6              22G  9.7G   11G  48% /data
/dev/hda3             996M   34M  911M   4% /tmp
/dev/hda2             2.0G  227M  1.7G  13% /var
tmpfs                 501M     0  501M   0% /dev/shm
In this case there is no /boot as it uses standard partitions so /boot isn't needed (grub is able to find the file it needs on the main partition).

Code:
[[email protected] ~]$ df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_web1_sys-lv_root
                      5.0G  1.3G  3.4G  28% /
tmpfs                 246M     0  246M   0% /dev/shm
/dev/sda1             504M   79M  400M  17% /boot
/dev/mapper/vg_web1_sys-lv_data
                      8.4G  519M  7.5G   7% /data
/dev/mapper/vg_web1_sys-lv_tmp
                      5.0G  171M  4.6G   4% /tmp
/dev/mapper/vg_web1_sys-lv_var
                      9.9G  420M  9.0G   5% /var
In this case I'm using LVM for partitioning so /boot is needed (grub can't find files on LVM)

In both cases /home isn't actually located on the / partition, in the first case it's linked to /data/home, in the second it's mounted over the network. So for a standalone system you might want to create a /home partition. These are both server builds, for a desktop build it's possible you'd have more software installed.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

How did your AQA A-level Business Paper 1 go?

Loved the paper - Feeling positive (200)
22.55%
The paper was reasonable (403)
45.43%
Not feeling great about that exam... (165)
18.6%
It was TERRIBLE (119)
13.42%

Watched Threads

View All
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise