Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-16-2006, 02:13 PM
|
#1
|
Member
Registered: Oct 2005
Location: Hannover, Germany
Distribution: Let there be Ubuntu... :o)
Posts: 573
Rep:
|
How to format a partition on an external USB drive
Hi, I'm trying to use gparted to format a partition on an external HDD, connected via USB.
This HDD is divided into a number of NTFS and ext3 partitions and also contains a boot sector. This is on Ubuntu 6.06 if it makes a difference.
OK, I plug-in the device and the contents will show up under /media/usbdisk, /media/usbdisk-1, etc.
I open GPartEd and choose /dev/sdc from the combobox. GPartEd then will list the partitions as /dev/sdc1, /dev/sdc2, etc.
Now, in order to format one of the partitions (an NTFS one), I unmount it first. GPartEd will throw loads of warnings and errors to the standard output:
Code:
Warning: Unable to open /dev/hdc read-write (Read-only file system). /dev/hdc has been opened read-only.
Error: Unable to open /dev/hdc - unrecognised disk label.
Error reading inode 701.
Error reading inode 1332.
Error reading inode 1531.
Error reading inode 1642.
Error reading inode 1677.
...
...
Couldn't read MFT Record 55547: Input/output error.
Error: Error opening /dev/sdc: No such device or address
Warning: Unable to open /dev/hdc read-write (Read-only file system). /dev/hdc has been opened read-only.
Error: Unable to open /dev/hdc - unrecognised disk label.
Next, GPartEd will popup a messagebox:
Code:
The kernel is unable to re-read the partitiontables on the following devices:
- /dev/sdc
Because of this you will only have limited access to these devices.
Unmount all mounted partitions on a device to get full access.
There is no file /dev/hdc, and also /dev/sdc* do not exist, BTW.
Could someone kindly tell me what's going on.
Thanks
|
|
|
08-16-2006, 04:41 PM
|
#2
|
Member
Registered: Oct 2003
Location: Spain
Distribution: Fedora
Posts: 104
Rep:
|
I think you better try fdisk which, in my opinion, is the best partitioon tool avalaible. First of all type "dmesg" just after plugging the device to check which is the assigned drive (e.g: sdc: sdc1, sdc2). Then use fdisk /dev/sdc. Press "d" to delete the existing partitions (first number "1"), press "d" again and then press "2" to delete the second partition. Once you have finished, type "w" to write changes to the disk. Then restart fdisk /dev/sdc, press "n" to create a new partition, press "1" to number the first partition, then press "p" to create a primary partition and finally assign the size you wish to this partition. Repeat this process for the second partition pressing "2" instead of "1". Press "t" to change the partition identification, as linux by default assign ext3 type to all the new partitions created. Then press "w" to exit saving changes to the disk and you will have your partitions ready to be formated. Afterwards, use mkfs -t ext3 /dev/sdc1 to format the first (Linux) partition. The second one must be formated under Windows due to Linux is unable to format ntfs filesystem type.
PD: HDC seems to be the cdrom drive under your system.
Good luck
Last edited by ilpadrino; 08-16-2006 at 04:44 PM.
|
|
|
08-16-2006, 05:43 PM
|
#3
|
Member
Registered: Oct 2005
Location: Hannover, Germany
Distribution: Let there be Ubuntu... :o)
Posts: 573
Original Poster
Rep:
|
Thanks!
The last relevant output of dmesg is:
Code:
[17193081.728000] usb 2-2.1: new full speed USB device using uhci_hcd and address 45
[17193081.832000] scsi5 : SCSI emulation for USB Mass Storage devices
[17193081.832000] usb-storage: device found at 45
[17193081.832000] usb-storage: waiting for device to settle before scanning
[17193086.868000] Vendor: SAMSUNG Model: MP0804H Rev: UE10
[17193086.868000] Type: Direct-Access ANSI SCSI revision: 00
[17193086.872000] SCSI device sde: 156368015 512-byte hdwr sectors (80060 MB)
[17193086.872000] sde: assuming drive cache: write through
[17193086.876000] SCSI device sde: 156368015 512-byte hdwr sectors (80060 MB)
[17193086.876000] sde: assuming drive cache: write through
[17193086.876000] sde: sde1 sde2 < sde5 > sde3
[17193087.376000] sd 5:0:0:0: Attached scsi disk sde
[17193087.376000] sd 5:0:0:0: Attached scsi generic sg0 type 0
[17193087.376000] usb-storage: device scan complete
[17193088.948000] printk: 9 messages suppressed.
[17193088.948000] NTFS-fs warning (device sde1): parse_options(): Option iocharset is deprecated. Please use option nls=<charsetname> in the future.
[17193089.592000] NTFS volume version 3.1.
[17193089.744000] NTFS-fs warning (device sde5): parse_options(): Option iocharset is deprecated. Please use option nls=<charsetname> in the future.
[17193089.980000] NTFS volume version 3.1.
[17193090.232000] 1:0:0:0: rejecting I/O to dead device
[17193090.232000] EXT3-fs error (device sdb3): ext3_readdir: directory #2 contains a hole at offset 0
[17193090.232000] 2:0:0:0: rejecting I/O to dead device
[17193090.232000] EXT3-fs error (device sdc3): ext3_readdir: directory #2 contains a hole at offset 0
[17193090.232000] 3:0:0:0: rejecting I/O to dead device
[17193090.232000] EXT3-fs error (device sdd3): ext3_readdir: directory #2 contains a hole at offset 0
[17193090.232000] 3:0:0:0: rejecting I/O to dead device
[17193090.232000] Buffer I/O error on device sdd3, logical block 0
[17193090.232000] lost page write due to I/O error on sdd3
[17193090.232000] ext3_abort called.
[17193090.232000] EXT3-fs error (device sdd3): ext3_journal_start_sb: Detected aborted journal
[17193090.232000] Remounting filesystem read-only
[17193090.608000] kjournald starting. Commit interval 5 seconds
[17193090.620000] EXT3 FS on sde3, internal journal
[17193090.620000] EXT3-fs: recovery complete.
[17193090.624000] EXT3-fs: mounted filesystem with ordered data mode.
Nevertheless, the file manager (Nautilus) displays the contents of the partitions well, and any file I've opened from there until now has opened without any problems.
It will return:
Code:
Unable to open /dev/sdc
I've also tried /dev/sdb and /dev/sdd, getting the same result.
Thanks again. It's, I don't have the knowledge how to interprete these messages. I would be willing to read some manuals, if necessary. - Most important now is, I don't know the next step.
|
|
|
08-17-2006, 04:29 AM
|
#4
|
Member
Registered: Oct 2003
Location: Spain
Distribution: Fedora
Posts: 104
Rep:
|
You can see here that your drive is assigneed as /dev/sde.
Quote:
SCSI device sde: 156368015 512-byte hdwr sectors (80060 MB)
[17193086.872000] sde: assuming drive cache: write through
[17193086.876000] SCSI device sde: 156368015 512-byte hdwr sectors (80060 MB)
[17193086.876000] sde: assuming drive cache: write through
[17193086.876000] sde: sde1 sde2 < sde5 > sde3
|
As I can see, you have four partition in your drive (numbered 1,2,5,3), which two of them(1 and 5) are ntfs filesystem. Nautilus mount them so you can see the contents. So if you want to fomat them, you have to type mkfs -t ext3 /dev/sde2&&mkfs -t ext3 /dev/sde3, in case you want to have two Linux partition and also want to mantain four partition in the disk. If not, delete all partition as I have posted before, plug the disk just after booting, type dmesg and post the result. I will then post exactly what you have to do.
Regards
|
|
|
08-17-2006, 08:15 AM
|
#5
|
Moderator
Registered: Aug 2002
Posts: 26,465
|
FYI
/dev/sde2 is an extended partition and this can not be formatted with a filesystem. In a nutshell it is a container for logical partitions i.e. sda5 in your case. Your data partitions are 1,3 & 5.
|
|
|
08-17-2006, 12:04 PM
|
#6
|
LQ Newbie
Registered: Jan 2006
Posts: 17
Rep:
|
I am guessing your USB drive is a standard ide/sata drive in a USB 'cradle'? if so, why not try taking the drive out of the usb device and attaching it to your pc, formatting it as you wish, then putting it back into the usb device?
|
|
|
08-17-2006, 02:21 PM
|
#7
|
Member
Registered: Oct 2005
Location: Hannover, Germany
Distribution: Let there be Ubuntu... :o)
Posts: 573
Original Poster
Rep:
|
It worked, thank you, indeed!
Here's what I did: Plugged in the device, and then
to identify which /dev/sd?[n] partition had been mapped to which /media/* mount point. - Then:
Code:
sudo umount /dev/sdc1
and then
Code:
sudo mkfs -t vfat /dev/sdc1
Plugged-in the drive again, et voila, the new filesystem! Really cool!
- Toxyn, this is a 2.5" external drive, being used from a standard PC. Also, directly connecting to it (not via USB) wouldn't actually improve anything (but access speed), I guess?
|
|
|
08-17-2006, 02:39 PM
|
#8
|
Member
Registered: Oct 2003
Location: Spain
Distribution: Fedora
Posts: 104
Rep:
|
Michaelk is OK. Sorry for the mistake
|
|
|
08-17-2006, 03:31 PM
|
#9
|
Member
Registered: Oct 2005
Location: Hannover, Germany
Distribution: Let there be Ubuntu... :o)
Posts: 573
Original Poster
Rep:
|
Thank you very much, ilpadrino. Even if you were wrong in details, you've saved me loads of time by providing me with the commands I needed. I would not be able to use Linux efficiently if there were not users like you who help me to get started. Your posting has been most helpful to me.
michaelk's posting has been helpful to me as I looked at the file system / mount point mappings more thoroughly.
- To me, personally, this thread is a full success! Teamwork in a way
Thanks all!
|
|
|
All times are GMT -5. The time now is 06:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|