[Sussex] Label and partition external hard drive
Desmond Armstrong
desmond.armstrong at gmail.com
Tue Feb 22 17:47:47 UTC 2011
On 22/02/11 15:48, 'Fay Zee' wrote:
> Hi All
>
> I've acquired a 3 1/2" 160GB e-SATA hard drive in an external USB case
> that I want to use to back up my files. I need to give it a meaningful
> volume name to distinguish it from my other external devices and I've
> searched and found some of the commands I need. But I'm stuck on steps
> 4, 5 and 6 below. Please could someone help me out? My preference is
> always for CLI over graphical as I can save the commands for future use.
>
> ---------------------------------------------------------
> 1. Discover the device name allocated to the external hdd
> and find out how many partitions it has
> ---------------------------------------------------------
> BEFORE attaching external hdd:
> $ ls -l /dev/sd*
> Now attach external hdd and re-run above command. Look for the added line.
>
> RESULT:
> brw-rw---- 1 root disk 8, 80 2011-02-19 23:45 /dev/sdf
> brw-rw---- 1 root disk 8, 81 2011-02-19 23:45 /dev/sdf1
>
> ---------------------------------------------------------
> 2. Discover the size of the external hard drive partition
> ---------------------------------------------------------
> # df /dev/sdf1
> (If multiple partitions, run $ df /dev/sdf*)
>
> RESULT:
> Filesystem Size Used Avail Use% Mounted on
> /dev/sdf1 150G 91M 149G 1% /media/New Volume
>
> ---------------------------------------------------------------------
> 3. Assign Dos type device name to the external hdd prior to using mlabel
> ---------------------------------------------------------------------
> # cat /etc/mtools.conf
> # echo -e "\ndrive x: file=\"/dev/sdf1\"" >> /etc/mtools.conf
>
> ---------------------------------------------------
> 4. Display existing volume name of the external hdd
> ---------------------------------------------------
> # mlabel ????????
> I want to know how to view the label first.
> I'm nervous at this point as I don't want to corrupt the drive.
>
> ---------------------------------------------
> 5. Give the external hard drive a volume name
> ---------------------------------------------
> mlabel or e2label or tune2fs are mentioned on this link:
> http://www.linuxquestions.org/questions/linux-general-1/how-to-change-volume-label-of-the-usb-drives-594875/
> But the instructions aren't precise enough - I don't want to corrupt
> the disk!
>
> ------------------------------------------------------------------
> 6. Partition the external hdd into 3 partitions of 50GB each
> Format one for a Windows file system and the others for Linux only
> ------------------------------------------------------------------
> I also need help here! This is my first external device large enough
> to benefit from partitioning (I've only ever partitioned during OS
> installation until now).
The tool available with the Mandriva system does allow this function
exactly as you require.
Not only can you set the partitions as you require, but then you can put
the labels on them.
So when I plug in my external drives they always come up with the
meaningful labels which I applied. Just remember that when you apply the
label you will wipe the partition, so label first then use.
More information about the Sussex
mailing list