Hi,
I am trying to modify my /etc/fstab to mount a drive (where I want to place a backup). From looking at the current setup created by anaconda, it looks like I have to setup using UUID or LABEL (however these seem to be blank, see below).
First, my setup.
I have one SSD that has / and all the partitions associated with it.
I have three additional drives, two of which are hardware (for historical reasons) RAIDed, and have /home in them, and a third new drive that is a "free agent" (sorry for not knowing the correct term, but I hope that I can convey the meaning).
I want this to be mounted at boot as /mnt/whatever (I have verified that this mount-point has been created and exists).
So, I look at my /dev/disk/by-disk-seq and see:
~$ ls 1@ 2@ 4@ 5@ 6@
~$ ll * lrwxrwxrwx. 1 root root 9 Mar 29 14:01 1 -> ../../sda lrwxrwxrwx. 1 root root 9 Mar 29 14:01 2 -> ../../sdb lrwxrwxrwx. 1 root root 9 Mar 29 14:01 4 -> ../../sdc lrwxrwxrwx. 1 root root 9 Mar 29 14:01 5 -> ../../sr0
OK, there is an a, b and c. The d is the first drive that has the /, the sr0 is the swap, and the a, b and c are the three drives.
It appears to me that the sda and sdc are the ones raided (they have the same UUID and also lsblk indicates so (I have made up the part numbers here, for security). I have to say that I expected sda and sdb to be the RAIDed drives, I thought that sdc would be the new one that has been put in. But perhaps I am wrong in my understanding.
Anyway,
$ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sda isw_raid_member 1.3.00 sda1 ext4 1.0 xxxxx md126 md126p1 ext4 1.0 xxxxx 116.3G 8% /home md127 sdb sdc isw_raid_member 1.3.00 sdc1 ext4 1.0 xxxxx md126 md126p1 ext4 1.0 xxxxx 116.3G 8% /home md127 sdd sdd1 vfat FAT32 E56F-E0D8 sdd2 ext4 1.0 yyyyy 595.9M 8% /boot sdd3 vfat FAT32 1616-D18F 933.7M 2% /boot/efi sdd4 ext4 1.0 uuuuu 43.2G 0% /tmp sdd5 ext4 1.0 vvvvv 43.2G 0% /usr/local sdd6 swap 1 wwwww [SWAP] sdd7 ext4 1.0 zzzzz 76.3G 14% / sr0 zram0 [SWAP]
But, my problem is that /dev/sdb does not appear to have a UUID number. Indeed, I get nothing back when I try:
$ sudo blkid /dev/sdb1
or even
$ sudo blkid /dev/sdb
So, how do I mount this drive onto my /etc/fstab? Sorry if things are not clear, but I am happy to clarify further and provide more information.
Many thanks for your help, and best wishes, Ranjan
On 3/29/23 21:45, Ranjan Maitra wrote:
I am trying to modify my /etc/fstab to mount a drive (where I want to place a backup). From looking at the current setup created by anaconda, it looks like I have to setup using UUID or LABEL (however these seem to be blank, see below).
First, my setup.
I have one SSD that has / and all the partitions associated with it.
I have three additional drives, two of which are hardware (for historical reasons) RAIDed, and have /home in them, and a third new drive that is a "free agent" (sorry for not knowing the correct term, but I hope that I can convey the meaning).
I want this to be mounted at boot as /mnt/whatever (I have verified that this mount-point has been created and exists).
So, I look at my /dev/disk/by-disk-seq and see:
~$ ls 1@ 2@ 4@ 5@ 6@
~$ ll * lrwxrwxrwx. 1 root root 9 Mar 29 14:01 1 -> ../../sda lrwxrwxrwx. 1 root root 9 Mar 29 14:01 2 -> ../../sdb lrwxrwxrwx. 1 root root 9 Mar 29 14:01 4 -> ../../sdc lrwxrwxrwx. 1 root root 9 Mar 29 14:01 5 -> ../../sr0
OK, there is an a, b and c. The d is the first drive that has the /, the sr0 is the swap, and the a, b and c are the three drives.
zram0 is the swap. sr0 is an optical disk drive of some sort.
It appears to me that the sda and sdc are the ones raided (they have the same UUID and also lsblk indicates so (I have made up the part numbers here, for security). I have to say that I expected sda and sdb to be the RAIDed drives, I thought that sdc would be the new one that has been put in. But perhaps I am wrong in my understanding.
The UUID has no security ramifications. It only matters if someone has physical access to your computer and if so, they would be able to read them anyway. The disk numbering depends on which port they're plugged into and which order those ports are scanned.
$ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sda isw_raid_member 1.3.00 sda1 ext4 1.0 xxxxx md126 md126p1 ext4 1.0 xxxxx 116.3G 8% /home md127 sdb sdc isw_raid_member 1.3.00 sdc1 ext4 1.0 xxxxx md126 md126p1 ext4 1.0 xxxxx 116.3G 8% /home md127 sdd sdd1 vfat FAT32 E56F-E0D8 sdd2 ext4 1.0 yyyyy 595.9M 8% /boot sdd3 vfat FAT32 1616-D18F 933.7M 2% /boot/efi sdd4 ext4 1.0 uuuuu 43.2G 0% /tmp sdd5 ext4 1.0 vvvvv 43.2G 0% /usr/local sdd6 swap 1 wwwww [SWAP] sdd7 ext4 1.0 zzzzz 76.3G 14% / sr0 zram0 [SWAP]
But, my problem is that /dev/sdb does not appear to have a UUID number. Indeed, I get nothing back when I try:
$ sudo blkid /dev/sdb1
Does that give nothing or an error? That listing indicates that the drive isn't partitioned at all. What does "fdisk -l /dev/sdb" show? Or run the "Disks" application (if you have Gnome) to see what's there and create a partition.
On 3/29/23 22:45, Joe Zeff wrote:
On 03/29/2023 10:45 PM, Ranjan Maitra wrote:
So, how do I mount this drive onto my /etc/fstab? Sorry if things are not clear, but I am happy to clarify further and provide more information.
Use gparted to give it a label.
If it doesn't have a partition, then you can't put a label. If it had a partition, there would be a UUID.
Am 30.03.2023 um 06:45 schrieb Ranjan Maitra mlmaitra@gmx.com:
Hi,
I am trying to modify my /etc/fstab to mount a drive (where I want to place a backup). From looking at the current setup created by anaconda, it looks like I have to setup using UUID or LABEL (however these seem to be blank, see below).
Don’t worry about UUID. There is no consistent rule how to specify a drive in fstab. And various Fedora tools handle it differently and you will have a mix of UUID or /dev/xxx specification.
First, my setup.
I have one SSD that has / and all the partitions associated with it.
I have three additional drives, two of which are hardware (for historical reasons) RAIDed, and have /home
As it looks, sda and sdc are software raid. If you had a hardware raid, all disks attached to the hardware raid controller show up as one drive. But doesn’t matter as long as it works.
in them, and a third new drive that is a "free agent" (sorry for not knowing the correct term, but I hope that I can convey the meaning).
I want this to be mounted at boot as /mnt/whatever (I have verified that this mount-point has been created and exists).
So, I look at my /dev/disk/by-disk-seq and see:
~$ ls 1@ 2@ 4@ 5@ 6@
~$ ll * lrwxrwxrwx. 1 root root 9 Mar 29 14:01 1 -> ../../sda lrwxrwxrwx. 1 root root 9 Mar 29 14:01 2 -> ../../sdb lrwxrwxrwx. 1 root root 9 Mar 29 14:01 4 -> ../../sdc lrwxrwxrwx. 1 root root 9 Mar 29 14:01 5 -> ../../sr0
OK, there is an a, b and c. The d is the first drive that has the /, the sr0 is the swap, and the a, b and c are the three drives.
It appears to me that the sda and sdc are the ones raided (they have the same UUID and also lsblk indicates so (I have made up the part numbers here, for security). I have to say that I expected sda and sdb to be the RAIDed drives, I thought that sdc would be the new one that has been put in. But perhaps I am wrong in my understanding.
Anyway,
$ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sda isw_raid_member 1.3.00 sda1 ext4 1.0 xxxxx md126 md126p1 ext4 1.0 xxxxx 116.3G 8% /home md127 sdb sdc isw_raid_member 1.3.00 sdc1 ext4 1.0 xxxxx md126 md126p1 ext4 1.0 xxxxx 116.3G 8% /home md127 sdd sdd1 vfat FAT32 E56F-E0D8 sdd2 ext4 1.0 yyyyy 595.9M 8% /boot sdd3 vfat FAT32 1616-D18F 933.7M 2% /boot/efi sdd4 ext4 1.0 uuuuu 43.2G 0% /tmp sdd5 ext4 1.0 vvvvv 43.2G 0% /usr/local sdd6 swap 1 wwwww [SWAP] sdd7 ext4 1.0 zzzzz 76.3G 14% / sr0 zram0 [SWAP]
But, my problem is that /dev/sdb does not appear to have a UUID number. Indeed, I get nothing back when I try:
At first you have to create a partition and a file system on the new drive, which seems to be /dev/sdb. (After that you should see UUIDs).
What says
cfdisk /dev/sdb ?
If you can, create a partition and afterwards a filesystem. Then try e.g. mount -t xfs|ext4 /dev/sdb1 /mnt
Thanks, very much, to all!
To answer the questions:
From: Peter Boy pboy@uni-bremen.de Date: Thu, 30 Mar 2023 08:03:25 +0200
I have three additional drives, two of which are hardware (for historical reasons) RAIDed, and have /home
As it looks, sda and sdc are software raid. If you had a hardware raid, all disks attached to the hardware raid controller show up as one drive. But doesn’t matter as long as it works.
I see, thanks! I assumed HW RAID since it was set up through the BIOS ages ago.
But, my problem is that /dev/sdb does not appear to have a UUID number. Indeed, I get nothing back when I try:
At first you have to create a partition and a file system on the new drive, which seems to be /dev/sdb. (After that you should see UUIDs).
What says
cfdisk /dev/sdb ?
So, I get a new screen come up, and "select label type" from "gpt", "dos", "sgi" and "sun". I guess this should be "gpt", so I tried that.
The process forward seemed straightforward, and I got a filesystem created with "Label" gpt, "identifier "some long alphanumeric name" and "Partition UUID" and of "Partition type: Linux file system", both the last with two other long alphanumeric names.
I went into "Type" but there is no option for "ext4" ("or xfs", for that matter) and so left it as "Linux file system" and then "Write" (wrote) to disk ("yes") and "Quit" to move on.
If you can, create a partition and afterwards a filesystem. Then try e.g. mount -t xfs|ext4 /dev/sdb1 /mnt
Here, however, I get:
$ sudo mount -t ext4 /dev/sdb1 /mnt mount: /mnt/backup: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error. dmesg(1) may have more information after failed mount system call.
dmesg says lots of selinux-related things, as always, but perhaps the one seems more useful:
[64087.184258] EXT4-fs (sdb1): VFS: Can't find ext4 filesystem
and
$ lsblk -f
now has the additional entry:
sdb └─sdb1
But that is it. Nothing more
I suspect that somewhere above, I should have been able to say that it was an ext4, but I can not figure out which of the "TYPE"s would have given me that.
To answer the earlier questions:
From: Samuel Sieb samuel@sieb.net Date: Wed, 29 Mar 2023 22:07:15 -0700
Now,
$ sudo blkid /dev/sdb1 /dev/sdb1: PARTUUID="some long alphanumeric number"
(earlier, it gave nothing at all).
$ fdisk -l /dev/sdb
Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors Disk model: WDC WD2005FBYZ-0 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: massive alphanumeric number
Device Start End Sectors Size Type /dev/sdb1 2048 3907028991 3907026944 1.8T Linux filesystem
From: Joe Zeff joe@zeff.us Date: Thu, 30 Mar 2023 00:06:04 -0600
So use gparted to partition and format it, and give it a label because it's easier to type a label into fstab than a UUID.
So, I have parted, and that is probably good enough (I am currently remote on the machine).
So, I do:
$ sudo parted /dev/sdb
GNU Parted 3.5 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) TYPE-UUID align-check TYPE N check partition N for TYPE(min|opt) alignment help [COMMAND] print general help, or help on COMMAND mklabel,mktable LABEL-TYPE create a new disklabel (partition table) mkpart PART-TYPE [FS-TYPE] START END make a partition name NUMBER NAME name partition NUMBER as NAME print [devices|free|list,all] display the partition table, or available devices, or free space, or all found partitions quit exit program rescue START END rescue a lost partition near START and END resizepart NUMBER END resize partition NUMBER rm NUMBER delete partition NUMBER select DEVICE choose the device to edit disk_set FLAG STATE change the FLAG on selected device disk_toggle [FLAG] toggle the state of FLAG on selected device set NUMBER FLAG STATE change the FLAG on partition NUMBER toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER type NUMBER TYPE-ID or TYPE-UUID type set TYPE-ID or TYPE-UUID of partition NUMBER unit UNIT set the default unit to UNIT version display the version number and copyright information of GNU Parted
I guess I can move mklabel, and then name it (can this be anything?). But where does it get the filesystem type from?
I did try type NUMBER UUID and the UUID number given above, but got:
Error: Partition doesn't exist.
Thanks again!
Best wishes, Ranjan
Am 30.03.2023 um 15:11 schrieb Ranjan Maitra mlmaitra@gmx.com:
Thanks, very much, to all!
To answer the questions:
From: Peter Boy pboy@uni-bremen.de Date: Thu, 30 Mar 2023 08:03:25 +0200
I have three additional drives, two of which are hardware (for historical reasons) RAIDed, and have /home
As it looks, sda and sdc are software raid. If you had a hardware raid, all disks attached to the hardware raid controller show up as one drive. But doesn’t matter as long as it works.
I see, thanks! I assumed HW RAID since it was set up through the BIOS ages ago.
Then you might have a BIOS Raid, where the BIOS provides some of the code instead of the Linux driver. Before you update to F38 and/or F39, you should study the release notes. Linux support for BIOS Raid changed, I don’t remember the details out of my head. They will NOT get totally unsupported, but you may have to install different drivers, maybe it’s updated automatic. As I said, I don’t remember the details.
But, my problem is that /dev/sdb does not appear to have a UUID number. Indeed, I get nothing back when I try:
At first you have to create a partition and a file system on the new drive, which seems to be /dev/sdb. (After that you should see UUIDs).
What says
cfdisk /dev/sdb ?
So, I get a new screen come up, and "select label type" from "gpt", "dos", "sgi" and "sun". I guess this should be "gpt", so I tried that.
The process forward seemed straightforward, and I got a filesystem created with "Label" gpt, "identifier "some long alphanumeric name" and "Partition UUID" and of "Partition type: Linux file system", both the last with two other long alphanumeric names.
I went into "Type" but there is no option for "ext4" ("or xfs", for that matter) and so left it as "Linux file system" and then "Write" (wrote) to disk ("yes") and "Quit" to move on.
If you can, create a partition and afterwards a filesystem. Then try e.g. mount -t xfs|ext4 /dev/sdb1 /mnt
Here, however, I get:
$ sudo mount -t ext4 /dev/sdb1 /mnt mount: /mnt/backup: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error. dmesg(1) may have more information after failed mount system call.
Yes, you must create a file system on the newly created partition. Currently xfs is the default, so you have to execute:
[…]$ sudo mkfs.xfs /dev/sdb1 […]$ sudo mount -t xfs /dev/sdb1 /mnt
or if you want to stay with ext4: […]$ sudo mkfs.ext4 /dev/sdb1 […]$ sudo mount -t ext4 /dev/sdb1 /mnt
And to make it permanent
[…]$ sudo vi /etc/fstab
and add at the end either /dev/sdb1 /mnt xfs defaults 0 0 or /dev/sdb1 /mnt ext4 defaults 0 0
Generally, /mnt is not a good option for a permanent mount. You should create either /srv/backups (srv for server or services) or at least /mnt/mybackups
$ fdisk -l /dev/sdb
Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors Disk model: WDC WD2005FBYZ-0 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: massive alphanumeric number
Device Start End Sectors Size Type /dev/sdb1 2048 3907028991 3907026944 1.8T Linux filesystem
That looks fine, exactly as it should be. Execute the steps above to create a filesystem.
Thanks very much!
On Thu Mar30'23 03:42:50PM, Peter Boy wrote:
From: Peter Boy pboy@uni-bremen.de Date: Thu, 30 Mar 2023 15:42:50 +0200
Then you might have a BIOS Raid, where the BIOS provides some of the code instead of the Linux driver. Before you update to F38 and/or F39, you should study the release notes. Linux support for BIOS Raid changed, I don’t remember the details out of my head. They will NOT get totally unsupported, but you may have to install different drivers, maybe it’s updated automatic. As I said, I don’t remember the details.
OK, thanks for this warning, I will remember to make sure.
What says
cfdisk /dev/sdb ?
So, I get a new screen come up, and "select label type" from "gpt", "dos", "sgi" and "sun". I guess this should be "gpt", so I tried that.
The process forward seemed straightforward, and I got a filesystem created with "Label" gpt, "identifier "some long alphanumeric name" and "Partition UUID" and of "Partition type: Linux file system", both the last with two other long alphanumeric names.
I went into "Type" but there is no option for "ext4" ("or xfs", for that matter) and so left it as "Linux file system" and then "Write" (wrote) to disk ("yes") and "Quit" to move on.
If you can, create a partition and afterwards a filesystem. Then try e.g. mount -t xfs|ext4 /dev/sdb1 /mnt
Here, however, I get:
$ sudo mount -t ext4 /dev/sdb1 /mnt mount: /mnt/backup: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error. dmesg(1) may have more information after failed mount system call.
Yes, you must create a file system on the newly created partition. Currently xfs is the default, so you have to execute:
[…]$ sudo mkfs.xfs /dev/sdb1 […]$ sudo mount -t xfs /dev/sdb1 /mnt
or if you want to stay with ext4: […]$ sudo mkfs.ext4 /dev/sdb1 […]$ sudo mount -t ext4 /dev/sdb1 /mnt
Right, got this to work, thanks!
And to make it permanent
[…]$ sudo vi /etc/fstab
and add at the end either /dev/sdb1 /mnt xfs defaults 0 0 or /dev/sdb1 /mnt ext4 defaults 0 0
lsblk now yields a UUID, so I guess i could use that for consistency with the rest, or the actual drive above. But, should I use 0 0 above, or 1 2, given that /home is 1 2. Since that is what I will be backing up hourly (after the first run), using changes per rsync to this drive).
In the current filesystem set up by anaconda, I have 1 1 for / 0 0 for swap and 1 2 for everything else.
Generally, /mnt is not a good option for a permanent mount. You should create either /srv/backups (srv for server or services) or at least /mnt/mybackups
I will do that, thank you!
Best wishes, Ranjan
Am 30.03.2023 um 16:02 schrieb Ranjan Maitra mlmaitra@gmx.com:
And to make it permanent
[…]$ sudo vi /etc/fstab
and add at the end either /dev/sdb1 /mnt xfs defaults 0 0 or /dev/sdb1 /mnt ext4 defaults 0 0
lsblk now yields a UUID, so I guess i could use that for consistency with the rest, or the actual drive above.
You can do that, yes. One reason for UUID is, when you do some hardware maintenance and reconnect the drives to different sata ports the naming can change. The previous /dev/sdb may become /dev/sdd etc. Using UUID make you to some degree independent from cabling and ports.
But, should I use 0 0 above, or 1 2, given that /home is 1 2. Since that is what I will be backing up hourly (after the first run), using changes per rsync to this drive).
The first „zero“: fs_freq: This field is used by dump(8) to determine which filesystems need to be dumped. Defaults to zero (don’t dump) if not present.
I suppose, you don’t want it to get dumped, so leave it zero
The second „zero“: fs_passno: This field is used by fsck(8) to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a fs_passno of 1. Other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. Defaults to zero (don’t check the filesystem) if not present.
Modern journaling filesystems as ext4 or xfs don’t need a file check at every boot time. So I think it is best to retain the default.
Best
-- Peter Boy https://fedoraproject.org/wiki/User:Pboy pboy@fedoraproject.org
Timezone: CET (UTC+1) / CEST (UTC+2)
Fedora Server Edition Working Group member Fedora docs team contributor Java developer and enthusiast
On Thu Mar30'23 04:23:30PM, Peter Boy wrote:
From: Peter Boy pboy@uni-bremen.de Date: Thu, 30 Mar 2023 16:23:30 +0200 To: Community support for Fedora users users@lists.fedoraproject.org Reply-To: Community support for Fedora users users@lists.fedoraproject.org Subject: Re: mounting a drive on F37
Am 30.03.2023 um 16:02 schrieb Ranjan Maitra mlmaitra@gmx.com:
And to make it permanent
[…]$ sudo vi /etc/fstab
and add at the end either /dev/sdb1 /mnt xfs defaults 0 0 or /dev/sdb1 /mnt ext4 defaults 0 0
lsblk now yields a UUID, so I guess i could use that for consistency with the rest, or the actual drive above.
You can do that, yes. One reason for UUID is, when you do some hardware maintenance and reconnect the drives to different sata ports the naming can change. The previous /dev/sdb may become /dev/sdd etc. Using UUID make you to some degree independent from cabling and ports.
But, should I use 0 0 above, or 1 2, given that /home is 1 2. Since that is what I will be backing up hourly (after the first run), using changes per rsync to this drive).
The first „zero“: fs_freq: This field is used by dump(8) to determine which filesystems need to be dumped. Defaults to zero (don’t dump) if not present.
I suppose, you don’t want it to get dumped, so leave it zero
The second „zero“: fs_passno: This field is used by fsck(8) to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a fs_passno of 1. Other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. Defaults to zero (don’t check the filesystem) if not present.
Modern journaling filesystems as ext4 or xfs don’t need a file check at every boot time. So I think it is best to retain the default.
Best
Thanks, I used it as 0 0 and used the UUID. So after editing the /etc/fstab, I have to do, per the file itself:
sudo systemctl daemon-reload
Do I need to do anything else to mount the drive?
Many thanks, Ranjan
-- Peter Boy https://fedoraproject.org/wiki/User:Pboy pboy@fedoraproject.org
Timezone: CET (UTC+1) / CEST (UTC+2)
Fedora Server Edition Working Group member Fedora docs team contributor Java developer and enthusiast
users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
On 3/30/23 07:34, Ranjan Maitra wrote:
Thanks, I used it as 0 0 and used the UUID. So after editing the /etc/fstab, I have to do, per the file itself:
sudo systemctl daemon-reload
Do I need to do anything else to mount the drive?
Either "mount -a" which mounts everything not already mounted or specifically "mount /mnt".