Linux Hard Drive Format Commands

Vikram

Member
Joined
3 Nov 2010
Messages
684
Reaction score
449
Mostly Advance set top box on linux like dreambox,openbox etc
here are Linux Hard Drive Format Commands


Partition the new disk using fdisk command

Following command will list all detected hard disks:

# fdisk -l | grep '^Disk'

output of the above command
Disk /dev/sda: 250.0 GB, 250000193024 bytes
Disk /dev/sdb: 250.0 GB, 250000193024 bytes

A device name refers to the entire hard disk. For more information see Linux partition naming convention and IDE drive mappings.
To partition the disk - /dev/sdb, enter:
# fdisk /dev/sdb

The basic fdisk commands you need are:

m - print help
p - print the partition table
n - create a new partition
d - delete a partition
q - quit without saving changes
w - write the new partition table and exit


Format the new disk using mkfs.ext3 command

To format Linux partitions using ext2fs on the new disk:

# mkfs.ext3 /dev/sdb1

Step#3 : Mount the new disk using mount command

First create a mount point /disk1 and use mount command to mount /dev/sdb1, enter:

# mkdir /disk1
# mount /dev/sdb1 /disk1
# df -H


Update /etc/fstab file

Open /etc/fstab file, enter:
# vi /etc/fstab

Append as follows:

/dev/sdb1 /disk1 ext3 defaults 1 2
Save and close the file.

Task: Label the partition

You can label the partition using e2label. For example, if you want to label the new partition /backup, enter

# e2label /dev/sdb1 /backup
You can use label name insted of partition name to mount disk using /etc/fstab:

LABEL=/backup /disk1 ext3 defaults 1 2
 
Very good post... i learned these commands when i was studying Unix subject in my 3rd semester engineering.... Unix is the predecessor of Linux OS.... Both have almost same environment of working :)
 
I have recently installed VideocondD2H 2222 HD box with which you can attach any USB for recording.

It formatted my 8GB pen drive perfectly. But it is not formatting my perfectly OK Seagate FreeAgent 320 GB External HDD.

It starts formatting but after 4-5 minutes says disk unusable.

I am downloading Ubuntu to format the disk myself with above commands. Hope it makes the disk work with the STB.

If you can provide any help or guidance, that would be great.
 
@manig: But it is not formatting my perfectly OK Seagate FreeAgent 320 GB External HDD.

But friend you didn't mention what was the OS on the HDD when you start format and also take in mind the best option is first Format the HDD in Linux OS PC and if it is Window's based means FAT-32 or NTFS file system then your STB will not Recognized it that is why it can't format it ok.

Suggestion : Don't do much Experiment with HDD if you don't have any knowledge of Commands or some Hardware of PC. So first read some Format help Instruction's and then follow the process.While doing un necessary Formats or wrongly updated file system may damage your HDD (corrupted) so it just a advice friend.
 
first format the hdd by connecting it in ur computer and then format it with d2h box
 
The drive was NTFS formatted but after attaching to STB 2222, it became unusable with Windows. But I can see the partitions in Disk Management and reformat if required. The drive is fine.

Now I will install Ubuntu and format it there and see if 2222 STB uses the disk without formatting it itself.
 
Back
Top Bottom
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock