[sf-lug] how to use fdisk to repartition a 1TB USB hard drive?
tom at greenleaftech.net
Sat Jun 13 00:19:01 PDT 2009
On Fri, 2009-06-12 at 21:28 -0700, jim wrote:
> i got a new 1TB USB stand-alone hard drive with a vfat
> file system and called itself "My Book".
> i figured i'd use fdisk to wipe the existing partition
> table and make a new 100GB partition, leave the rest raw
> and make new parts as i see the needs.
> i used fdisk, which showed four screwy partitions and
> then told me the device didn't seem to have a valid
> partition table, maybe i screwed up.
> i ignored fdisk's sarcasm and deleted the four screwy
> partitions and then made a new 100GB partition. fdisk
> seemed happy.
> partprobe didn't like things.
> i rebooted. and then...
> It still calls itself "My Book". I'd like to fix that
> along with other things.
Once you create ext3 partitions on there, use e2label to assign a name
to the device and this will be respected in the name it's assigned when
> ubuntu 8.04,
> # fdisk -l Device Boot Start End Blocks
> /dev/sdb1 1 121601 976760001 c W95
> FAT32 (LBA)
> <JS: the above looks the way it came before i used
> fdisk to wipe out the weird non-partitions that fdisk
> complained about (along with a somewhat snide remark
> that there was no partition table, i must have made
> a mistake), and then create a single 100MB partition.>
> # fdisk /dev/sdb1
> Command (m for help): p
> Disk /dev/sdb1: 1000.2 GB, 1000202241024 bytes
> 255 heads, 63 sectors/track, 121600 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> Disk identifier: 0x73696420
> Device Boot Start End Blocks Id System
> /dev/sdb1p1 1 123 987966 83 Linux
> <JS: the above is what fdisk reports now, after i'd
> used fdisk to make a 100 MB partition and rebooted
> the whole system.>
> # mount | grep sdb
> /dev/sdb1 on /media/My Book type vfat
> <JS: i would have tho't that blasting the old
> partition table and creating a new one would have
> blasted the stupid space-in-the-middle name, but
> no: when the system reboots, it sees the drive as
> it was originally, a vfat 1TB USB drive named
> "My Book".>
> # cd /media/My*
> # df -h .
> Filesystem Size Used Avail Use% Mounted on
> /dev/sdb1 932G 2.0G 930G 1% /media/My Book
> <JS: and df sees the same old 1TB thing rather than
> a nice new 100GB thing.>
> <JS: so far, the internet has not revealed how to
> repartition this thing:
> Western Digital My Book 1 TB USB stand alone hard drive,
Rick's comments may be a better way to go, but I believe what you need
to do in fdisk is run fdisk on the drive itself (/dev/sdb) rather than
partitions within it (/dev/sdb1). This will allow you to delete all
existing paritions, create new ones (and specify the right filesystem
type - most likely ext3).
More information about the sf-lug