Changeset 3550 in MondoRescue for branches/3.2/MondoRescue
- Timestamp:
- Apr 4, 2016, 4:49:46 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/MondoRescue/bin/mr-label
r3522 r3550 121 121 my($inputfh, $buffer, $offset, $length, $hexlabel); 122 122 123 # Evaluate the size of the FAT with blkid -p 124 open(FS,"blkid -p $inputf|") || die "$0: cannot blkid -p $inputf: $!"; 125 my $verfs = <FS>; 126 close(FS); 127 $verfs =~ s/.*VERSION="FAT([0-9][0-9]).*"/FAT$1/; 128 chomp($verfs); 129 pb_log(1,"Working on a FS ot type ***$verfs***\n"); 130 123 131 open($inputfh, "+< $inputf") || die "$0: cannot open $inputf for reading/writing: $!"; 124 132 binmode($inputfh) || die "binmode failed: $!"; 125 133 134 # Source https://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html 126 135 if (defined $label) { 127 # 42 first bytes are untouched 128 $offset = 43; 136 # x first bytes are untouched 137 $offset = 43 if (($verfs =~ /FAT16/) || ($verfs =~ /FAT12/)); 138 $offset = 71 if ($verfs =~ /FAT32/); 129 139 $length = 11; 130 140 } elsif (defined $uuid) { 131 # 38 first bytes are untouched 132 $offset = 39; 141 # x first bytes are untouched 142 $offset = 39 if (($verfs =~ /FAT16/) || ($verfs =~ /FAT12/)); 143 $offset = 67 if ($verfs =~ /FAT32/); 133 144 $length = 4; 134 145 } else {
Note:
See TracChangeset
for help on using the changeset viewer.