[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Intended question - was {Re: Forgot name of Debian "configuration" {wrong word?} file}



Richard Owlett composed on 2019-06-16 14:17 (UTC-0500):

> David Wright wrote:

>> or, even easier,
 
>>    Use a LABEL to indicate the swap partition in all your own
...> I can't parse that.
 
I recommend learning to use LABELs on all your filesystems. They are massively
easier for humans to work with than UUIDs. You get to assign them in accordance
with how your brain functions, e.g.:

# <file system> 	<mount point>   <type>  <options>			<dump> <pass>
LABEL=m12P01esp 	/boot/efi	vfat	codepage=437			0 0
LABEL=m12p02swap		swap	swap	defaults			0 0
LABEL=m12p03usrlcl	/usr/local	ext4	noatime,data=ordered		0 2
LABEL=m12p04home	/home		ext4	noatime,acl,user_xattr,data=ordered 0 2
LABEL=m12p05stw		/disks/stw	ext4	noatime,acl,user_xattr,nofail	0 0
LABEL=m12p06s150	/disks/s150	ext4	noatime,acl,user_xattr,nofail	0 0
LABEL=m12p07s151	/disks/s151	ext4	noatime,acl,user_xattr,nofail	0 0
LABEL=m12p08deb10		/	ext4	noatime,errors=remount-ro	0 1
LABEL=m12p09Ubionic	/disks/buntu	ext4	noatime,acl,user_xattr,nofail	0 0
LABEL=m12p10mint19	/disks/mint	ext4	noatime,acl,user_xattr,nofail	0 0

In case you're wondering about the above naming logic, m12 is simply the last
three characters of the disk's serial number, something to reduce possibility
of label duplication when swapping disks around, or cloning.

Labeling makes output lines in blkid longer, but that enables making parsing much
easier for most human brains. Labels can be especially helpful with multiboot in
constructing custom boot stanzas much shorter and more easily parsable compared
to those generated by grub-mkconfig, e.g.:

menuentry "Debian 10 Buster" {
	search --no-floppy --set=root --hint-baremetal=ahci0,gpt8 --label m12p08deb10
	linux	/vmlinuz root=LABEL=m12p08deb10 noresume
	initrd	/initrd.img
}

The exercise might even make the string /etc/fstab more memorable. :-D
-- 
Evolution as taught in public schools is religion, not science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/


Reply to: