2

Can you help me find UUID of my SSD which is partitioned already? The goal is I want to mount this SSD under my home dir. To do so, I need to add a line to my /etc/fstab file. To do so, I need to put its UUID in the line. To do so, I need to determine its UUID. Nothing is output by command blkid, which baffles me. The advice in the fstab file says:

" Use 'blkid' to print the universally unique identifier for a device"

and I certainly have this device, and this device is certainly working, and certainly partitioned, and I used sudo, but blkid steadfastly won't print anything about this device's UUID for some reason. But maybe the UUID is already being shown in the file /etc/fstab as UUID=69A1-BD52 so I don't really need blkid to work, and I can skip that nonsense. Not sure. OS is Ubuntu 14.04LTS.

Here is my current fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/ubuntu--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda2 during installation
UUID=9b4fb887-5dd8-413c-b0b0-dd3c803cf4ab /boot           ext2    defaults        0       2
# /boot/efi was on /dev/sda1 during installation
UUID=69A1-BD52  /boot/efi       vfat    umask=0077      0       1
/dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0
/dev/nvme0n1 /mnt/fastssd auto nosuid,nodev,nofail,x-gvfs-show 0 0
# Following was added by ga for permanent fast swap file on ssd with high priority as created at cmd line earlier
/mnt/fastssd/100GiB.swap none swap sw 0 0

Here is output of df command:

$ df
Filesystem                   1K-blocks      Used  Available Use% Mounted on
udev                          65956452         0   65956452   0% /dev
tmpfs                         13196096      9816   13186280   1% /run
/dev/mapper/ubuntu--vg-root 1789679056  27183296 1671562308   2% /
tmpfs                         65980460         0   65980460   0% /dev/shm
tmpfs                             5120         4       5116   1% /run/lock
tmpfs                         65980460         0   65980460   0% /sys/fs/cgroup
/dev/nvme0n1                 492128608 104929192  362177652  23% /mnt/fastssd
/dev/sda2                       483946    250653     208308  55% /boot
/dev/sda1                       523248      3668     519580   1% /boot/efi
tmpfs                         13196096         0   13196096   0% /run/user/1000

Here is me running blkid to try to see the UUID:

$ blkid /dev/nvme0n1
$ blkid /mnt/fastssd
$ sudo blkid /mnt/fastssd
$ blkid /dev/sda1

Nothing outputted. I did not omit any output. My sudo login was successful.

This device is already partitioned and formatted and working nicely. Shouldn't every partitioned device already have a UUID?

Is UUID=69A1-BD52 its UUID? Can I confirm this?

Most important question: Can I safely repeat the UUID=69A1-BD52 in the new line I wish to add to my fstab file, so it will mount this SSD under my home directory?

Example of line I would add to my fstab if it's safe and correct to do so:

UUID=69A1-BD52  /home/user/fastssd auto   rw,noauto,user,sync          0  2

The above line is just a big guesstimate, and I don't know if 2 belongs there etc.

This device would be mounted twice. Is it safe or do I need to remove a line? I don't have a reason to keep the old mount location if the new mount location is OK. Would I need to change my SSD swap file entry if I move it to being under my home directory? It's OK by me for this device to be inaccessible to other users, as its my computer.

  • 4
    Type blkid without any arguments. Also the output of lsblk can be helpful as well. – datUser Dec 8 '16 at 15:04
  • @datUser: sudo blkid with no parameters returned the uuid, thanks. To mount it under the home dir can I just add a line to fstab or do I also need to delete a line from fstab so its not double-mounted? Does double mounting the same device hurt anything? And will my other line for the swap mount to this ssd need changing if I delete the old line from fstab? thanks. – Geoffrey Anderson Dec 8 '16 at 15:49
2

Edit: As it turns out, the OP actually had a filesystem made on the unpartitioned SSD.

You probably don't want to mount the SSD. Probably you want to mount a partition on the SSD. To list the UUIDs of partitions:

sudo lsblk -o name,mountpoint,size,type,ro,label,uuid

Example result:

$ sudo lsblk -o name,mountpoint,size,type,ro,label,uuid
NAME                  MOUNTPOINT  SIZE TYPE  RO LABEL           UUID
sda                                40G disk   0                 
├─sda1                /boot       286M part   0 SERVERAX-BOOT   2db37cbc-6c0cb-4833-4511-3476aabf55d
└─sda2                           39.7G part   0                 2148212e-3652d-4c16-8115-2230b7c98a7
  └─Serverax                     39.7G crypt  0                 BU961-FLmD-mXHQta-VUkW-xPAQ-2H4D-vubDr
    ├─Serverax-Swap   [SWAP]      1.7G lvm    0 SERVERAX-SWAP   bef1e619-85a9a-44eb-43fd-c404b4fdc8a
    ├─Serverax-System /            20G lvm    0 SERVERAX-SYSTEM c0a7b4d2-a6515-436d-e10f-bca5a2340ef
    ├─Serverax-Home   /home        10G lvm    0 SERVERAX-HOME   8f410236-4e4c8-45f4-ab15-a8398dfa6fa
    └─Serverax-Srv    /srv          6G lvm    0 SERVERAX-SRV    0ceb5cd2-937e8-4c75-d4c4-67d5a10168f
sr0                              1024M rom    0                 

If you can, it is better to set your terminal to 132 columns before running the command.

  • Ooh nice output, thanks for this command. It still says type=disk not type=part so I'm still confused. There is no other line appearing regarding this ssd, such as something saying type=part for the partition that is definitely on that thing. I just copied a file to it, despite not having a type=part on that bugger. Look: nvme0n1 /mnt/fastssd 477G disk 0 fastone 7e3f91f2-2395-4018-b4fe-16bd7e644047 – Geoffrey Anderson Dec 8 '16 at 15:56
  • Maybe you have formatted the disk and not partitioned it? What does sudo file -s /dev/sdx (with /dev/sdx replaced with the SSD disk device, of course)? – AlexP Dec 8 '16 at 15:57
  • Can I mount a disk that is not partitioned? Because I think, actually I know, I mounted it -- /mnt/fastssd is operational. So maybe I do want to mount the disk not the partition. what you think – Geoffrey Anderson Dec 8 '16 at 15:59
  • Partitioning is a way of dividing the disk into independent sub-disks. Linux doesn't care for the difference between a full disk and a partition. You won't be able to partition it later, though. – AlexP Dec 8 '16 at 16:01
  • if you give my Q an upvote, I will give you the accepted answer to the nominal question in my title. However I am still left with unresolved question or 2 about fstab which is the ultimate goal of this inquiry (see above). thank you – Geoffrey Anderson Dec 8 '16 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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