#46 Issue closed: Save swap label for old distributions

Labels: bug

jhoekx opened issue at 2012-03-30 07:54:

Reported by Shabahang Elmian on the mailing list:

If there are some swap partitions with labels(refered in fstab by label), they are not labled and automatically used. we should run manual "mkswap -L <Label_name> <Dev_name> (eg. mkswap -L SWAP-sda9 /dev/sda9)

jhoekx commented at 2012-03-30 07:55:

We label swap on recovery.

We fail to record it on old distributions. Currently swaplabel is required to find the swap label and UUID.

gdha commented at 2012-04-04 07:58:

./save/GNU/Linux/24_swaps_layout.sh contains the swaplabel command, however, on RHEL 5.* swaplabel does not exists (to my best knowledge). Wouldn't it be better to fetch the label out the /etc/fstab file?

gdha commented at 2012-04-05 11:31:

The blkid command is able to link the label to a partition, e.g.

$ /sbin/blkid
/dev/mapper/vg00-lv04: UUID="3f76fc74-42f2-4a91-841c-eb0bd3d4e756" TYPE="ext3"
/dev/mapper/vg00-lv06: UUID="82e8b000-b5a8-44ab-b7ef-cdbe249fb0da" TYPE="ext3"
/dev/mapper/vg00-lv05: UUID="f6b85465-4d14-4d26-bea0-040718c10f22" TYPE="ext3"
/dev/mapper/vg00-lv02: UUID="88976d04-acec-42db-81c7-a316848681ed" TYPE="ext3"
/dev/mapper/vg00-lv03: UUID="4acfa80f-d1fb-43ca-b0d6-99e9dedf8531" TYPE="ext3"
/dev/mapper/vg00-lv01: UUID="69ddfca5-f183-4aa3-b84e-1dcc7fb476e6" TYPE="ext3"
/dev/mapper/vg00-lv00: UUID="633c03bd-b3fe-4b24-a242-60d63d3209d0" TYPE="ext3"
/dev/mapper/vg_data-lv_data: UUID="6a538b10-dd04-442e-afcb-524c472a5e3d" TYPE="ext3"
/dev/cciss/c0d0p3: TYPE="swap" LABEL="SW-cciss/c0d0p3"
/dev/cciss/c0d0p1: LABEL="/boot" UUID="febb7a29-878f-47b1-9331-8bd9476beccb" TYPE="ext3" SEC_TYPE="ext2"
/dev/vg00/lv00: UUID="633c03bd-b3fe-4b24-a242-60d63d3209d0" TYPE="ext3"

The blkid command exists on RHEL, Fedora, SLES, other I don't know...

dagwieers commented at 2012-04-05 18:50:

For this we may still need rear_volume_id functionality after all. But before we make a decision, let's make sure we understand all the situations in which we need rear_volume_id functionality (blkid, udev_volume_id or vol_id) and whether all distributions are covered. We need to make sure that when /etc/fstab refers swaps by label, a restore and reboot works as expected. (RHEL4 and older distributions might be affected...)

dagwieers commented at 2012-04-05 18:51:

And the automated testing infrastructure would be super-handy for this :-)


[Export of Github issue for rear/rear.]