Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Please help, I will be forever grateful!

I've built a system to use as a file server, with one 120GB SSD and one 4TB HDD. I've installed Ubuntu Server and I want to have the OS on the SSD and the files on the HDD. During the installation process the SSD was sda and the HDD was sdb. During install I created 3 new partitions. One 112GB partition on the 120GB SSD with mount point /, one 8GB swap area on the 120GB SSD and one 4TB partition on the 4TB HDD with mount point /home.

(I installed grub boot loader on sda, which was the SSD)

How can I check that this is all set up correctly? When I type in sudo fdisk -l it says

"Disk /dev/sda: 4000GB" (this was sdb during install?!?)

"/dev/sda1: Partition 1 does not start on a physical sector boundary. (I didn't create a 2nd partition on the HDD though??)

And it also says

"/dev/sdb: 120GB (So my SSD has somehow changed from sda to sdb?)

Disk /dev/mapper/cryptswap1: 8033MD Disk /dev/mapper/cryptswap1 doesnt contain a valid partition table"

So does this mean the swap area I made didnt work? And my sda and sda have somehow swapped names? How can I confirm the OS is installed on the SSD and then create some directories like 'Movies' Music' 'Photos' etc on the HDD so I can them share them across my network.

I've just installed openssh-server and samba and stuff and now the tutorial says to cd to root directory and then use mkdir to create my folders. But will this create them on the HDD like I want? Or on the SSD? So confused!

If someone could tell me the commands to type in to see which drive the OS is installed on and the commands to create directories on the HDD it would be much much appreciated.

Thank you

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You cannot rely on sdX to remain the same (it probably will, but no guarantees). You should use either labels or UUIDs. See the devices in /dev/disks/by-label and /dev/disk/by-UUID. You can check which drives have been used as currently by using the mount command (which will use sdX in the output). To fix your cryptswap, edit the file /etc/crypttab to use UUIDs.

The Ubuntu installer uses UUIDs by default in fstab and crypttab, so you shouldn't have to manually edit them. Applications like parted cannot identify encrypted swap, since the partition appears to be filled with garbage to them. (If they ever identify them successfully, there's something very wrong going on.) You can check usage of swap using the swapon -s command.

That a partition doesn't start on a physical boundary doesn't mean much these days. Today's disks don't really expose the real physical state.

share|improve this answer
    
I typed in 'blkid' and it displayed the UUIDs for sda1, sdb1, sdb2 and mapper/cryptswap1. How do I edit the file "/etc/crpyttab" to use UUIDS, I just replace something in that file with the relevant UUID? And if I cd and then start making directories will they be on my HDD or SSD? Can I just go mkdir /home/user/files/movies and mkdir home/user/files/music etc etc to make folders on the HDD? –  Dylan Jul 15 at 11:20
    
@DylanFirst Usually you can replace /dev/sdaX with UUID=blah-blah-blah-blah. Check using mount whether the desired drives are mounted in the right locations. In general they should be, since the fstab as generated during installation uses UUIDs. –  muru Jul 15 at 11:24
    
So is my swap area broken? Because I opened /etc/crypttab/ and its already using UUID. It says "cryptswap1 UUID = blahblahblah /dev/urandom swap,cipher=aes blahblahblah" –  Dylan Jul 15 at 11:54
    
@DylanFirst I must have been high when I wrote this answer. :D Your swap is fine. Because encrypted swap is filled with random data that looks like garbage, tools like parted cannot identify them. If swapon -s shows you are using swap, then its all good. –  muru Jul 15 at 12:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.