GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
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.
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.
Hope I am posting in the right place.
I have a pen-drive which was working,normally until recently. I must have pulled it out mistakenly when it was still active(I was working on windows). Linux seems to detect it and allows me to view and edit the files. However, on windows, I get the following error as soon as I insert the drive :
" There is no disk in drive. Please insert a disk into drive \Device\Harddisk1\DR7".
Also, windows does not even allow me to format this volume. Does linux have a tool that can be used to format this drive? Or, Is there some other way to make the drive work?
Does linux have a tool that can be used to format this drive? Or, Is there some other way to make the drive work?
Look at the output of "dmesg" to see what device your drive uses (e.g. /dev/sdc). Then you can format the partition using mkfs.vfat. The syntax will look like
Yeah, i un-mounted the drive and tried it again. :
Code:
mkfs.vfat -v /dev/sda
mkfs.vfat 2.11 (12 Mar 2005)
mkfs.vfat: Will not try to make filesystem on full-disk device '/dev/sda' (use -I if wanted)
[root@zeus ~]# mkdosfs /dev/sda
mkdosfs 2.11 (12 Mar 2005)
mkdosfs: Will not try to make filesystem on full-disk device '/dev/sda' (use -I if wanted)
Also. what is the -I option it is talking about? I checked the man pages, i didnt seem to find the -I option.
-I Normally you are not allowed to use any 'full' fixed disk devices. mkdosfs will complain and tell you that it
refuses to work. This is different when using MO disks. One doesn't always need partitions on MO disks. The file
system can go directly to the whole disk. Under other OSes this is known as the 'superfloppy' format.
This switch will force mkdosfs to work properly.
usb-storage: device scan complete
scsi 0:0:0:0: Attached scsi generic sg0 type 0
SCSI device sda: 1974271 512-byte hdwr sectors (1011 MB)
sda: Write Protect is off
sda: Mode Sense: 00 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 1974271 512-byte hdwr sectors (1011 MB)
sda: Write Protect is off
sda: Mode Sense: 00 00 00 00
sda: assuming drive cache: write through
sda: unknown partition table
sd 0:0:0:0: Attached scsi removable disk sda
SELinux: initialized (dev sda, type vfat), uses genfs_contexts
This indicates that your USB drive is "/dev/sda".
Quote:
Originally Posted by kris.c
Code:
[root@zeus ~]# mkfs.vfat -v /dev/sda
mkfs.vfat 2.11 (12 Mar 2005)
mkfs.vfat: /dev/sda contains a mounted file system.
[root@zeus ~]# mkdosfs /dev/sda
mkdosfs 2.11 (12 Mar 2005)
mkdosfs: /dev/sda contains a mounted file system.
I can see that you figured out how to unmount it from previous posts.
Along with "/dev/sda", you should also have "/dev/sda1". That is the first partition on the thumb drive. 99.99% of thumb drives only have one partition.
To format it, use "mkfs.vfat -v /dev/sda1". As another poster mentioned, typically you cannot create a file system without a partition. I do not recommend using the "superfloppy" method as it is not as portable a format as plain old partition tables.
If it is too late, and you have already trashed your partition table, you can always learn how to use fdisk.
Code:
# fdisk /dev/sda
The number of cylinders for this disk is set to 14593.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
Press "p" to see a list of partitions (which may be empty). Press "n" to add a partition. You will want to add a "primary" partition by pressing "p" again. You want to use the first table entry by pressing "1". Change the type using "t" to "c" for FAT32. Save your changes by pressing "w".
The above instructions leave out some steps, but they explain the parts that you would probably have the most questions about.
It still doesnt seem to format it. I have un-mounted it and have used the mkdosfs with the -I option and this is what I get :
Code:
[root@zeus media]# mkfs.vfat -I -v /dev/sda
mkfs.vfat 2.11 (12 Mar 2005)
Auto-selecting FAT32 for large filesystem
/dev/sda has 32 heads and 61 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 1974270 sectors;
file system has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 1925 sectors, and provides 246298 clusters.
Volume ID is 4777b186, no volume label.
[root@zeus media]# mkfs.vfat -I -v /dev/sda1
mkfs.vfat 2.11 (12 Mar 2005)
/dev/sda1: No such file or directory
Coming to fdisk, even after executing the previous command, I get the following output when i use "p";
Code:
[root@zeus media]#fdisk /dev/sda1
Unable to open /dev/sda1
[root@zeus media]#fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 1010 MB, 1010826752 bytes
32 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/sda1 ? 398636 983425 570754815+ 72 Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(357, 116, 40) logical=(398635, 6, 23)
Partition 1 has different physical/logical endings:
phys=(357, 32, 45) logical=(983424, 30, 61)
Partition 1 does not end on cylinder boundary.
/dev/sda2 ? 86419 1078237 968014120 65 Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(288, 115, 43) logical=(86418, 26, 1)
Partition 2 has different physical/logical endings:
phys=(367, 114, 50) logical=(1078236, 17, 53)
Partition 2 does not end on cylinder boundary.
/dev/sda3 ? 957932 1949749 968014096 79 Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(366, 32, 33) logical=(957931, 2, 32)
Partition 3 has different physical/logical endings:
phys=(357, 32, 43) logical=(1949748, 25, 36)
Partition 3 does not end on cylinder boundary.
/dev/sda4 ? 1478321 1478349 27749+ d Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(372, 97, 50) logical=(1478320, 8, 25)
Partition 4 has different physical/logical endings:
phys=(0, 10, 0) logical=(1478348, 22, 13)
Partition 4 does not end on cylinder boundary.
Partition table entries are not in disk order
I tried manually deleting the partitions using "d" and creating a new one using "n" and finally using "w" to write the changes onto the disk, however on re-plugging the drive, i still get the above output when I use "p". The changes dont seem to have been written onto the disk.
[root@zeus media]# mkfs.vfat -I -v /dev/sda1
mkfs.vfat 2.11 (12 Mar 2005)
/dev/sda1: No such file or directory
[/code]
Leave out the "-I" here. And do this _after_ you have created the partition.
Quote:
Originally Posted by kris.c
Coming to fdisk, even after executing the previous command, I get the following output when i use "p";
You destroyed the partition table by using "mkfs.vfat -I -v /dev/sda". Run "dd if=/dev/zero of=/dev/sda bs=512 count=1" to zero it out. Then run "fdisk /dev/sda".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.