Sæt etiket på din usb disk

Etiketten

Faktisk er det ikke disken du sætter etiket på men partitionen

e2label /dev/sdXY "Min Disk"

tune2fs -L "Min Disk" /dev/sdXY

Find disk og partition

Men hvordan finder du nu sdXY?

~ >>> lsblk                                                                    
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0 223,6G  0 disk 
├─sda1    8:1    0   513M  0 part /boot/efi
├─sda2    8:2    0  31,3G  0 part /
├─sda4    8:4    0  15,6G  0 part 
├─sda5    8:5    0  15,6G  0 part 
├─sda6    8:6    0  15,6G  0 part 
├─sda7    8:7    0  15,6G  0 part 
├─sda8    8:8    0  15,6G  0 part 
├─sda9    8:9    0  15,6G  0 part 
└─sda10   8:10   0  98,1G  0 part /media/home
sdb       8:16   0   1,4T  0 disk 
├─sdb1    8:17   0  29,8G  0 part 
└─sdb2    8:18   0   1,3T  0 part /media/builder
sdc       8:32   0   1,8T  0 disk 
└─sdc1    8:33   0   1,8T  0 part /media/usb/data-2000
sdd       8:48   0   477G  0 disk 
└─sdd1    8:49   0 419,1G  0 part /media/usb/data-512
sde       8:64   0 238,5G  0 disk 
└─sde1    8:65   0 238,5G  0 part /media/vbox
sdf       8:80   0 238,5G  0 disk 
└─sdf1    8:81   0 238,5G  0 part /media/fhdata
sdg       8:96   0 232,9G  0 disk 
└─sdg1    8:97   0   200G  0 part /media/sources
sdh       8:112  0 465,8G  0 disk 
└─sdh1    8:113  0 465,8G  0 part /media/build
sdn       8:208  1   980M  0 disk /run/media/fh/sysrcd-4.9.4

Mere info om Etiketter og partitioner

Diskpart and OEM-recovery partitions

Unhide Recovery Partition

Start Disk Management (diskmgmt.msc) on your computer and take a closer look at your hard disk. Note the disk number and the partitions.
Start DiskPart and select your disk:

DISKPART> select disk 0

List all partitions:

DISKPART> list partition

Now, select the hidden partition (see step 1)

DISKPART> select partition 1
DISKPART> detail partition 

Verify that it is hidden.
Remember the Type value, this will be handy if something goes wrong.
Set the type of the hidden partition to 07.

DISKPART> set id = 07 override

If everything goes ok, you will receive the following message

“Diskpart successfully set the partition ID.“

All done.

DISKPART> Exit 

to close DiskPart.

Check the Disk Management to see witch drive letter has been assigned to the recovery partition.

List of partition types:

07 = Windows NT NTFS, 17 = Hidden, 27 = OEM Recovery

Assuming that you have cloned your hard drive containing the system onto a new one with a different storage capacity. This has made it impossible to create a Recovery drive including the content of the recovery partition, the checkbox “Copy the recovery partition from the PC to the recovery drive” being disabled. The reason is simple: the BCD entries (Boot Configuration Data) are based on disk signature/partition addresses. Therefore, if partitions are moved/resized, BCD entries are no longer actual.

Usually, the PC comes with a hidden Recovery partition which has no assigned letter but only a name, and containing a file named install.wim (or winRe.wim). You cannot display the content of this partition in Windows Explorer because it has no letter. The only thing you might say about it is “this partition starts at a certain offset” (number of bytes from the beginning of the disk). Windows won’t be able to find it if you provide a wrong offset, and this is exactly what happens when you install a new hard drive: the recovery partition may not start at the same offset as on the former one. So you have to provide Windows with the new offset by updating the content of a system file.

First of all, you need to determine which hidden partition contains the recovery file (install.wim or winre.wim). It’s most likely the biggest and last one, and its size should be something like 14 GB or greater. In the image below, which shows the partitions of my own hard drive, the Recovery partition is named PBR_DRV and its size is 24 GB.

1 – Open a command prompt (or Windows PowerShell) with admin rights.
In case you want to make this partition visible in Windows Explorer, so that you can check its content, you need to assign a letter to it.

DISKPART> list volumes
DISKPART> select volume x
DISKPART> assign
DISKPART> remove

2 – Open the XML file C:\Windows\System32\Recovery\ReAgent.xml. Locate the line “PBRImageLocation”. Set its offset and guid accordingly to the values you found above.

3 – Open a new command prompt or Windows PowerShell with admin rights, and enter reagentc /disable, followed by reagentc /enable.

You should now be able to create a Recovery drive with the option “Copy the recovery partition from the PC to the recovery drive” enabled.