I have a USB drive that has been formatted as NTFS. Can I reformat it? I have identified these properties about it
/dev/sda1 /media/Extrnl_Bkup
Not sure what to do next since the GUI will not mount a NTFS disk (expected).
Todd
On 5/24/07, Todd Cary todd@aristesoftware.com wrote:
I have a USB drive that has been formatted as NTFS. Can I reformat it? I have identified these properties about it
/dev/sda1 /media/Extrnl_Bkup
Not sure what to do next since the GUI will not mount a NTFS disk (expected).
There are kernel ntfs modules, but really, the most universally supported option is to format with vfat. This way it will work on windows, mac and linux systems, fully supported all the way around. There are some limitations to fat32, 4G file sizes and the like.
The quick and easy way is mkfs.vfat /dev/sda1....tap fingers for a minute... then unplug/reinsert.
Jim -
Thank you! That is exactly what I needed. I had to make one change though since I use rsync to copy the data to the USB drive: I could not use vfat. Instead, I used ext3. With vfat, I got errors when it tried to do a chmod (expected).
I do have another fs question though. A couple of weeks ago I noticed that the USB icon was not on my desktop when I turned the drive on. Not knowing any better, I ran my rsync with the following:
/usr/bin/rsync -av --exclude=".*" -e ssh /home/ /media/usbdisk/
And it went ahead and did it's thing *but* the drive was inoperable...dead. Where did the data go?
And I noticed with the new drive, if I turn it off, rsync puts the data somewhere with
/usr/bin/rsync -av --exclude=".*" -e ssh /home/ /media/usbdisk1/
I need a FS 101 course!!
Todd
Jim Perrin wrote:
On 5/24/07, Todd Cary todd@aristesoftware.com wrote:
I have a USB drive that has been formatted as NTFS. Can I reformat it? I have identified these properties about it
/dev/sda1 /media/Extrnl_Bkup
Not sure what to do next since the GUI will not mount a NTFS disk (expected).
There are kernel ntfs modules, but really, the most universally supported option is to format with vfat. This way it will work on windows, mac and linux systems, fully supported all the way around. There are some limitations to fat32, 4G file sizes and the like.
The quick and easy way is mkfs.vfat /dev/sda1....tap fingers for a minute... then unplug/reinsert.
Todd Cary spake the following on 5/24/2007 4:11 PM:
Jim -
Thank you! That is exactly what I needed. I had to make one change though since I use rsync to copy the data to the USB drive: I could not use vfat. Instead, I used ext3. With vfat, I got errors when it tried to do a chmod (expected).
I do have another fs question though. A couple of weeks ago I noticed that the USB icon was not on my desktop when I turned the drive on. Not knowing any better, I ran my rsync with the following:
/usr/bin/rsync -av --exclude=".*" -e ssh /home/ /media/usbdisk/
And it went ahead and did it's thing *but* the drive was inoperable...dead. Where did the data go?
And I noticed with the new drive, if I turn it off, rsync puts the data somewhere with
/usr/bin/rsync -av --exclude=".*" -e ssh /home/ /media/usbdisk1/
I need a FS 101 course!!
You don't need the -e ssh command if you are copying locally. Just use /usr/bin/rsync -av /home/ /media/usbdisk1/ --exclude=".*"
As for your copy with an unmounted drive, the copy should have gone to /media/usbdisk . Try a ls /media/usbdisk
Scott -
Whoops! In the past, I was RSYNCing to a backup/standby server and forgot to modify the command.
Thank you.....
Todd
Scott Silva wrote:
Todd Cary spake the following on 5/24/2007 4:11 PM:
Jim -
Thank you! That is exactly what I needed. I had to make one change though since I use rsync to copy the data to the USB drive: I could not use vfat. Instead, I used ext3. With vfat, I got errors when it tried to do a chmod (expected).
I do have another fs question though. A couple of weeks ago I noticed that the USB icon was not on my desktop when I turned the drive on. Not knowing any better, I ran my rsync with the following:
/usr/bin/rsync -av --exclude=".*" -e ssh /home/ /media/usbdisk/
And it went ahead and did it's thing *but* the drive was inoperable...dead. Where did the data go?
And I noticed with the new drive, if I turn it off, rsync puts the data somewhere with
/usr/bin/rsync -av --exclude=".*" -e ssh /home/ /media/usbdisk1/
I need a FS 101 course!!
You don't need the -e ssh command if you are copying locally. Just use /usr/bin/rsync -av /home/ /media/usbdisk1/ --exclude=".*"
As for your copy with an unmounted drive, the copy should have gone to /media/usbdisk . Try a ls /media/usbdisk
On 5/24/07, Todd Cary todd@aristesoftware.com wrote:
Jim -
Thank you! That is exactly what I needed. I had to make one change though since I use rsync to copy the data to the USB drive: I could not use vfat. Instead, I used ext3. With vfat, I got errors when it tried to do a chmod (expected).
Right, fat filesystems have no real concept of permissions.
I do have another fs question though. A couple of weeks ago I noticed that the USB icon was not on my desktop when I turned the drive on. Not knowing any better, I ran my rsync with the following:
/usr/bin/rsync -av --exclude=".*" -e ssh /home/ /media/usbdisk/
And it went ahead and did it's thing *but* the drive was inoperable...dead. Where did the data go?
Very likely it created a directory named usbdisk in /media, and sync'd the files there. If you plug something in with a label of 'usbdisk', it'll get mounted there, and hide the existence of the files underneath. Provides an interesting 'low-tech' way to hide files occasionally. they're not WELL hidden, but hey...
I need a FS 101 course!!
Will a 104 course work? http://www.ibm.com/developerworks/edu/l-dw-linux-lpic1104-i.html You might want to look at the LPI study material. About 50% is junk you'll never use and will mostly likely forget within 15 minutes, but some is the obscure fact material that will help save your geek ass one day :-P
Jim et al -
<< Very likely it created a directory named usbdisk in /media, and sync'd the files there. If you plug something in with a label of 'usbdisk', it'll get mounted there, and hide the existence of the files underneath. >> So, the question for me is how does Linux know if there is a USB drive so the info is transferred there or to create a "local directory" and put the data in it? I would have expected an error message, "Hey, dummy. The drive is not connected".
Todd
Jim Perrin wrote:
On 5/24/07, Todd Cary todd@aristesoftware.com wrote:
Jim -
Thank you! That is exactly what I needed. I had to make one change though since I use rsync to copy the data to the USB drive: I could not use vfat. Instead, I used ext3. With vfat, I got errors when it tried to do a chmod (expected).
Right, fat filesystems have no real concept of permissions.
I do have another fs question though. A couple of weeks ago I noticed that the USB icon was not on my desktop when I turned the drive on. Not knowing any better, I ran my rsync with the following:
/usr/bin/rsync -av --exclude=".*" -e ssh /home/ /media/usbdisk/
And it went ahead and did it's thing *but* the drive was inoperable...dead. Where did the data go?
Very likely it created a directory named usbdisk in /media, and sync'd the files there. If you plug something in with a label of 'usbdisk', it'll get mounted there, and hide the existence of the files underneath. Provides an interesting 'low-tech' way to hide files occasionally. they're not WELL hidden, but hey...
I need a FS 101 course!!
Will a 104 course work? http://www.ibm.com/developerworks/edu/l-dw-linux-lpic1104-i.html You might want to look at the LPI study material. About 50% is junk you'll never use and will mostly likely forget within 15 minutes, but some is the obscure fact material that will help save your geek ass one day :-P
On Thu, May 24, 2007 at 08:54:29PM -0700, Todd Cary enlightened us:
Jim et al -
<< Very likely it created a directory named usbdisk in /media, and sync'd the files there. If you plug something in with a label of 'usbdisk', it'll get mounted there, and hide the existence of the files underneath. >> So, the question for me is how does Linux know if there is a USB drive so the info is transferred there or to create a "local directory" and put the data in it? I would have expected an error message, "Hey, dummy. The drive is not connected".
Because there's nothing special about drives in Linux. They're all just files/directories. /media has no special meaning to the kernel, only the user, so the system will happily let you create folders wherever you want. If the folder happens to be physically located on another drive, it will put the files there. That's one of the beauties of Unix-like filesystems - it all looks the same regardless of drives/partitions/etc.
It's up to you to check that the drive is there before running rsync.
Matt
Matt -
Many thanks! Yes, that makes absolute sense once I cleared my mind of M$.
Todd
Matt Hyclak wrote:
On Thu, May 24, 2007 at 08:54:29PM -0700, Todd Cary enlightened us:
Jim et al -
<< Very likely it created a directory named usbdisk in /media, and sync'd the files there. If you plug something in with a label of 'usbdisk', it'll get mounted there, and hide the existence of the files underneath. >> So, the question for me is how does Linux know if there is a USB drive so the info is transferred there or to create a "local directory" and put the data in it? I would have expected an error message, "Hey, dummy. The drive is not connected".
Because there's nothing special about drives in Linux. They're all just files/directories. /media has no special meaning to the kernel, only the user, so the system will happily let you create folders wherever you want. If the folder happens to be physically located on another drive, it will put the files there. That's one of the beauties of Unix-like filesystems - it all looks the same regardless of drives/partitions/etc.
It's up to you to check that the drive is there before running rsync.
Matt
Todd Cary spake the following on 5/24/2007 8:54 PM:
Jim et al -
<< Very likely it created a directory named usbdisk in /media, and sync'd the files there. If you plug something in with a label of 'usbdisk', it'll get mounted there, and hide the existence of the files underneath. >> So, the question for me is how does Linux know if there is a USB drive so the info is transferred there or to create a "local directory" and put the data in it? I would have expected an error message, "Hey, dummy. The drive is not connected".
Because in linux, everything mounts under one directory tree. So to mount something in that tree, the "directory" needs to exist first. If that drive isn't mounted, the mountpoint will still exist, and can hold data by itself. Unless you set up something like automount that would create the mountpoint, and mount the drive, and after you disconnect, would remove the mountpoint. It would have to check if the drive was there before it created the mountpoint, and stop if it wasn't. Linux has unix roots, and it pre-dates things like removable drives. It comes from a time when drives were large and expensive, and stayed in place once attached.
On 5/25/07, Scott Silva ssilva@sgvwater.com wrote:
Because in linux, everything mounts under one directory tree. So to mount something in that tree, the "directory" needs to exist first. If that drive isn't mounted, the mountpoint will still exist, and can hold data by itself. Unless you set up something like automount that would create the mountpoint, and mount the drive, and after you disconnect, would remove the mountpoint. It would have to check if the drive was there before it created the mountpoint, and stop if it wasn't. Linux has unix roots, and it pre-dates things like removable drives. It comes from a time when drives were large and expensive, and stayed in place once attached.
As far as I can tell, all USB drives are handled by automount. My /media is empty unless there is something attached to the machine that "should" live there, like a USB drive or a DVD/CD in one of my DVD drives.
On Fri, May 25, 2007 at 11:15:59AM -0700, Mark Hull-Richter enlightened us:
Because in linux, everything mounts under one directory tree. So to mount something in that tree, the "directory" needs to exist first. If that drive isn't mounted, the mountpoint will still exist, and can hold data by itself. Unless you set up something like automount that would create the mountpoint, and mount the drive, and after you disconnect, would remove the mountpoint. It would have to check if the drive was there before it created the mountpoint, and stop if it wasn't. Linux has unix roots, and it pre-dates things like removable drives. It comes from a time when drives were large and expensive, and stayed in place once attached.
As far as I can tell, all USB drives are handled by automount. My /media is empty unless there is something attached to the machine that "should" live there, like a USB drive or a DVD/CD in one of my DVD drives.
Or you run an rsync command with a destination in /media/foo :-)
Matt
Found this old message about formatting a USB drive and it leaves a few questions for me:
I am going to format it as ext3 to keep permissions. I don't need to use this drive on any M$ system.
Do I unmount the drive after inserting it before I issue:
mkfs.ext3 /dev/sda1
BTW, when I do a 'man mkfs.ext3' it takes me to the man pages for mke2fs.
After the format is done, do I have to do anything to make sure everything is 'written' to the drive before pulling it from the system?
Jim Perrin wrote:
On 5/24/07, Todd Cary todd@aristesoftware.com wrote:
I have a USB drive that has been formatted as NTFS. Can I reformat it? I have identified these properties about it
/dev/sda1 /media/Extrnl_Bkup
Not sure what to do next since the GUI will not mount a NTFS disk (expected).
There are kernel ntfs modules, but really, the most universally supported option is to format with vfat. This way it will work on windows, mac and linux systems, fully supported all the way around. There are some limitations to fat32, 4G file sizes and the like.
The quick and easy way is mkfs.vfat /dev/sda1....tap fingers for a minute... then unplug/reinsert.
On Thu, Sep 25, 2008 at 17:05, Robert Moskowitz rgm@htt-consult.com wrote:
Do I unmount the drive after inserting it before I issue: mkfs.ext3 /dev/sda1
Yes, if it's mounted, unmount it before running the mkfs command.
BTW, when I do a 'man mkfs.ext3' it takes me to the man pages for mke2fs.
Yes, they are the same.
After the format is done, do I have to do anything to make sure everything is 'written' to the drive before pulling it from the system?
After formatting, no, the empty ext3 filesystem should be written on the drive and safe.
If you mount it and write data to it, you should unmount it before unplugging, otherwise you may lose data.
HTH, Filipe
On Thu, Sep 25, 2008 at 2:05 PM, Robert Moskowitz rgm@htt-consult.com wrote:
Found this old message about formatting a USB drive and it leaves a few questions for me:
Would you please stop top-posting?
Thanks.
mhr
On Thu, Sep 25, 2008 at 05:05:54PM -0400, Robert Moskowitz wrote:
Found this old message about formatting a USB drive and it leaves a few questions for me:
I am going to format it as ext3 to keep permissions. I don't need to use this drive on any M$ system.
Do I unmount the drive after inserting it before I issue:
mkfs.ext3 /dev/sda1
BTW, when I do a 'man mkfs.ext3' it takes me to the man pages for mke2fs.
After the format is done, do I have to do anything to make sure everything is 'written' to the drive before pulling it from the system?
After the format is finished give it time to push all the bits to the device. Run fsck on it at least once as a test... Since mkfs operates on the raw device there is 'little' risk if you count to 15 after fsck exits and remove...
In use, always.... sync, umount it. The graphical tools to unmount the volume do this for you.
Also consider asking if ext2 or another FS is a better choice than ext3. The journal is a busy place and might be a hot spot on the USB flash memory. The journal may also use more blocks than you expect. Ext3 on spinning disks is more reliable because of the way spinning disks work but a flash disk might go goofy with half a flash block write in progress.
There are some flash memory specific filesystems out there... web search for stuff like: "JFFS2 · Journaling Flash File System" 'LogFS, "a scalable flash filesystem"' etc... Some of the issues do not matter on a $9.00 USB key but the big USB keys are more expensive than I like.