The following command seems to complete the operation, no error is
shown, and this swap partition does work; It can be turned on and used
normally:
# mkswap /dev/sdc1 -L SWAP0
Setting up swapspace version 1, size = 3010412 kB
LABEL=SWAP0, UUID=f2d84959-bd43-45ea-8027-13b58ef1fe2f
However, running vol_id for this partition reports the following:
# vol_id /dev/sdc1
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=07D7-0A05
ID_FS_UUID_ENC=07D7-0A05
ID_FS_LABEL=DellUtility
ID_FS_LABEL_ENC=DellUtility
ID_FS_LABEL_SAFE=DellUtility
For some reason the label remained unchanged when running mkswap -L
SWAP0. Here are the first 100 bytes of the partition:
# hexdump /dev/sdc1 -C -n 100
00000000 eb 54 90 44 65 6c 6c 20 38 2e 30 00 02 04 01 00 |.T.Dell
8.0.....|
00000010 02 00 02 00 00 f8 5e 00 3f 00 ff 00 3f 00 00 00
|......^.?...?...|
00000020 47 78 01 00 80 00 29 05 0a d7 07 44 65 6c 6c 55
|Gx....)....DellU|
00000030 74 69 6c 69 74 79 46 41 54 31 36 20 20 20 10 00
|tilityFAT16 ..|
00000040 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|................|
00000050 00 00 00 00 00 00 33 c0 8e d0 bc 00 07 fc b9 80
|......3.........|
00000060 00 8e d8 be |....|
I gathered all this information from my console buffer, but I was in a
hurry to solve the situation and I already zeroed the beginning of the
partition. After that, mkswap -L behaved as expected. Unfortunatelly, by
doing this I have destroyed any evidence beyond the 100 bytes pasted above.
# dd if=/dev/zero of=/dev/sdc1 bs=512 count=512
# mkswap /dev/sdc1 -L SWAP0
Setting up swapspace version 1, size = 3010412 kB
LABEL=SWAP0, UUID=a0bc031b-6598-41bf-a709-5f6612310bd1
# vol_id /dev/sdc1
ID_FS_USAGE=other
ID_FS_TYPE=swap
ID_FS_VERSION=2
ID_FS_UUID=a0bc031b-6598-41bf-a709-5f6612310bd1
ID_FS_UUID_ENC=a0bc031b-6598-41bf-a709-5f6612310bd1
ID_FS_LABEL=SWAP0
ID_FS_LABEL_ENC=SWAP0
ID_FS_LABEL_SAFE=SWAP0
# swapon -V
swapon: (util-linux-ng 2.13.1.1)
This hard drive was part of a Dell Vostro PC. It was repartitioned but I
guess that the beginning of the first partition matches with the
beginning original one. This first partition seems to have been part of
some obscure Dell's system utility you can access by holding certain
keys during the computer boot. In any case, and correct me if I am
wrong, "mkswap -L" should overwrite any existing label, even if it is
corrupt or broken.
Version of util-linux-ng is 2.13.1.1. provided by Debian 'stable'
package util-linux 2.13.1.1-1.
--
Iván Stepaniuk
Alba Fotónica S.L.
www.albafotonica.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html