Pages

How to format a flashdisk in Fedora 14


If you are confused about how to format a pendrive in Linux, please carefully look at the following tutorial.

1 As usual, log in to your root acount using the shell, never use the ordinary user, because the process require root/superuser level.
[bagong@chsserver ~]$ su
Password: (your_root_password)
2. If you dont know where the mounted flash disk is, the device's is placed in what folder and what is vendor id number, please type the following command in the shell.

- display the flashdisk vendor and product id.
lsusb
the result from the command are.
[root@chsserver bagong]# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 04ca:002f Lite-On Technology Corp.
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 015: ID 125f:c03a A-DATA Technology Co., Ltd.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
- showing the location of the mount point of the flash device
df -h
the result from the command are.
[root@chsserver bagong]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda7 9.7G 6.6G 2.7G 72% /
tmpfs 497M 684K 496M 1% /dev/shm
/dev/sda5 44G 26G 19G 58% /media/DATA
/dev/sdb5 246G 227G 19G 93% /media/[data_b]
/dev/sdb6 247G 65G 182G 27% /media/[data_c]
/dev/sdc1 1.9G 1.9G 3.0M 100% /media/A-DATA
/dev/sdb1 109G 27G 83G 25% /media/[data_a]
/dev/sdb7 332G 188G 144G 57% /media/[files]
here, my flashdisk named A-DATA with vendor id 0x125f and product id 0xc03a mounted by system in folder /media/A-DATA and the device is mounted in folder /dev/sdc1.

3. Unmount the flashdisk, by right clicking the flash icon and select eject or safely remove the device or if using the terminal  simply use.
umount /dev/(flashdisk_device_name)
example
umount /dev/sdc1
4. After the flashdisk is unmounted run parted application in terminal.
/sbin/parted /dev/(your_flashdisk_name)
example
/sbin/parted /dev/sdc1
the result from the command are.
[root@chsserver bagong]# /sbin/parted /dev/sdc1
GNU Parted 2.3
Using /dev/sdc1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
To view the partition table, type.
(parted) print
the result from the command are.
(parted) print
Model: Unknown (unknown)
Disk /dev/sdc1: 1053MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number  Start  End     Size    File system  Flags
1      0.00B  1053MB  1053MB  fat16
To start formatting type.
mkfs 1 fat32
it means make partition with FAT32 type partition in partition number 1

the result from the command are.
(parted) mkfs 1 fat32
WARNING: you are attempting to use /sbin/parted to operate on (mkfs) a file system.
/sbin/parted's file system manipulation code is not as robust as what you'll find in dedicated, file-system-specific packages like e2fsprogs.
We recommend you use /sbin/parted only to manipulate partition tables,
whenever possible. Support for performing most operations on most types of file systems will be removed in an upcoming release.
Warning: The existing file system will be destroyed and all data on the partition will be lost. Do you want to continue?
/sbin/parted: invalid token: 1
Yes/No? Yes
mission successfull, you have formatted your flashdisk.

Hopefully this article is helpful.

0 comments:

Post a Comment