Formatting USB hard drives for Ubuntu (Gutsy Gibbon)
Recently my home Network Attached Storage (NAS) started acting flaky, so I wanted to back up my data. I picked up a 750 gigabyte Seagate Free Agent Pro drive. Here’s how I fixed a couple annoyances:
1. The drive is formatted with ntfs.
That’s great for Windows computers, but I preferred to format into a native Linux filesystem like ext3 or ext2. Rather than typing commands like mk2efs myself, I installed a wonderful utility called gparted. GParted lets you format and partition hard drives. Type the following:
sudo apt-get install gparted
sudo gparted
GParted is pretty intuitive, and it looks something like this:

If you’ve just plugged your drive into the computer, unmount the drive by selecting the external drive (under GParted->Devices) and then doing Partition->Unmount. Then make sure the correct drive is selected (under GParted->Devices again). Once the right device is selected, click on the partition you want to format. You’ll see a dashed box appear around the partition that you clicked (see the picture above where “/dev/sdf1″ has been clicked). Now click Partition->Format to . I recommend “ext3″ because it’s a very stable file system. Finally, click “Apply” on the menu bar and just wait 3-4 minutes. GParted will do all the formatting for you.
2. Give the partition a label
It’s nice if you plug in an external hard drive and you see something more descriptive than “disk” or “usbdisk”. If you formatted the drive as ext3 in step 1, you can use e2label (from the e2fsprogs set of utilities) to give your drive a persistent name. Each time you plug in that drive, you’ll see the same label for that drive. Attach the USB drive to the computer and use the “mount” command to identify the partition to add a label to. Normally you’ll see something like “/media/disk” mapping to a device like “/dev/sdX” where X is a letter like a, b, or c. Suppose the disk partition that you want to label is /dev/sdf1 and you want to call the hard drive “M1″. Here’s how to do it:
mount
sudo apt-get install e2fsprogs
sudo e2label /dev/sdf1
sudo e2label /dev/sdf1 “M1″
sudo e2label /dev/sdf1
The command “sudo e2label /dev/sdf1″ will query /dev/sdf1 to see what label it has. If there is no label, you will get back a blank line. The above command makes the label be “M1″. The final command reads the label back. If everything worked correctly, the final command should return the word “M1″. I’d stick with a short and simple label (under 16 characters, and nothing fancy schmancy like punctuation/spaces).
3. The Seagate Free Agent Pro drive can spin down under Linux when you don’t want it to.
There’s a setting in the hard drive that you can easily modify with the “sdparm” program. Install sdparm with “sudo apt-get install sdparm”. Then imagine that your device is /dev/sdX (again, X will normally be a letter like ‘b’ or ‘c’). Here’s what I typed to see the setting and modify it:
mount
sdparm -al /dev/sdX
sudo sdparm --clear STANDBY -6 /dev/sdX
sdparm -al /dev/sdX
You should see a line that looks like “STANDBY 1 [cha: y, def: 1, sav: 1] Standby timer active” change to “STANDBY 0 [cha: n, def: 1, sav: 0] Standby timer active“. If the drive has already spun down, you can unplug it, reboot everything, and plug it back in. Or the handy command “sudo sdparm --command=start /dev/sdX” might also wake it up.
The “-6″ is a fallback for some older types of drives and I think it’s pretty safe to include on sdparm commands.
Further reading on how the Seagate Free Agent Pro spins down:
http://alienghic.livejournal.com/382903.html
http://hardware.slashdot.org/article.pl?sid=07/12/09/0651200
Leslie Said,
January 14, 2008 @ 11:42 pm
Matt how about talking a bit about why Google is taking referral ads away from European publishers and only allowing them for US based publishers. I have websites that are based in the US, have most a US audience but now cannot show adsense referrals because I live in Ireland.
What is going on? Or are you going to keep to the company line?
Google have sent me an email to let me know of the decision but I cannot write back - it is no reply - come on, how hard is it to just let this run? When systems are set up already it must cost to take this away.
Gary R. Hess Said,
January 15, 2008 @ 1:07 am
@Leslie, Matt works in a completely different department.. he isn’t on the AdSense team.
@Matt, I have always heard good things about Seagate. It’s sad to hear something like this come up. Hopefully they will give a response soon.
Sarkipedia, Edit Said,
January 15, 2008 @ 1:33 am
Dear Leslie, Google always was taking referral ads away from European publishers. They are go now on different diretions / countries over the newasts European countries.
Thomas R. Hayes Said,
January 15, 2008 @ 4:01 am
I was considering getting a Seagate external hard drive also but may consider something else in light of some of the problems you are experiencing. Are there any other external hard drives you would recommend?
Kyle Lady Said,
January 15, 2008 @ 5:24 am
If I recall correctly, you technically “should” be using `gksudo gparted` in part 1. Running graphical programs using sudo can be 100% fine, or it can cause all sorts of problems.
Now, I would guess that it is likely that GParted wouldn’t do anything that could cause those problems, but it is a good practice to use gksudo for graphical applications. Additionally, you can make shortcuts (launchers?) using gksudo, while you have to run sudo from a terminal to see the password prompt.
Thanks for the good reference regarding naming disks…
Tim Wintle Said,
January 15, 2008 @ 5:45 am
Thanks for that Matt, It’s much easier than trying to remember all the command line parameters and what device my new usb dongle has been entered as.
More of these Ubuntu tips please . . .
Omar Yesid MariƱo Said,
January 15, 2008 @ 6:49 am
Oh, nice post about Linux and other related subjects related, but I hope you write about Google and SEO again soon.
Chris Said,
January 15, 2008 @ 7:13 am
I understand your frustration, Leslie. I have a site in one of my spaces that’s flooded with spam right now. I have half a dozen sites pushing me down in the the SERPs and their tactics are so obvious it’s hard to believe (hundreds of links from sites on one IP, several times over).
However, we have to acknowledge and appreciate that this is Matt’s personal blog. I know we all appreciate it when he spends his free time helping us, but honestly we aren’t entitled to it. If he want’s to talk about hard drives that’s his right.
On that note, I just picked up a WD mybook (500GB) on newegg for $129 a couple weeks ago. Love it, and it’s my second one w/o problems.
Paul Said,
January 15, 2008 @ 7:31 am
@Leslie - I think that you mis-read Google’s intention - it is only intending to remove referrals from your site to the Adsense product itself, referrals to other products will continue.
See this post for more details - http://adsense.blogspot.com/2008/01/upcoming-referrals-changes.html
Cheers, Paul
Jonathan Dingman Said,
January 15, 2008 @ 7:49 am
What happened to all the Googly posts you were making????
we want more Google!!!
Matt Cutts Said,
January 15, 2008 @ 8:09 am
Leslie, I have no idea. That’s on the ads side of the company and I haven’t talked to anyone involved in the decision. I’ve read a few posts where people said “get a disposable or one-time credit card and open up new AdWords accounts to get those sign-up bonuses!” So it’s possible that it was because of some type of abuse. But the short answer is that I wouldn’t give my speculation on the issue any more weight than any other person out on the web, because I don’t have any additional info/perspective on this issue.
Matt Cutts Said,
January 15, 2008 @ 8:12 am
Tim Wintle, you warmed the cockles of my heart.
Gary R. Hess, you try to win them over your way (calling/emailing them). I’m going to try the backdoor approach: buy so many Seagate drives that I turn around and find that I’m a Seagate shareholder, then use that power to effect change in Seagate’s policies. I’m sure if I buy just 1-2 more drives…
Jonathan, I’ll circle back around to Google posts in a bit, but with the holiday season I got a pent-up desire to talk about gadgets a little more. Maybe it’s Macworld in the air.
Maurice Said,
January 15, 2008 @ 8:15 am
there is a ton of info on how linux’s handle spin down on the Nslu2 linux pages which is running about running various linux distributions on the linksys nslu2.
http://www.nslu2-linux.org/
Dr. David Klein (purposeinc) Said,
January 15, 2008 @ 9:58 am
Hey Matt,
Thanks for the Linux post. I had to look at Wikipedia to realize that Ubuntu is an operating system which is a primarily desktop focused version of Linux. (assuming I understood correctly
I am looking at new machines, with this strange far off dream of eventually being able to be M.S. Windows free some day. What is Linux like for those with less coding skill to use? How would it work in an office enviroment where most of the people have no programming experience and are regular M.S. windows users?
Thanks,
dk
Eric Lander Said,
January 15, 2008 @ 10:27 am
Matt, I love that you broke up my monotonous SEO reading with some Ubuntu love. My only question — Why not Fiesty? I’m running 7.10 on my old Dell Inspiron as well as my main production and blogging PC at home.
I’m new to *nix, but after playing around with gOS a bit, I needed something more gritty — and Ubuntu seems the best fit for me of the major releases. I liked Core 8, but found it to be more of a dog on my gear.
Take care!
- Eric
Eric Lander Said,
January 15, 2008 @ 10:29 am
dk — Ubuntu is wonderful. I hooked my mother up with a machine to use (she still thinks AOL *is* the Internet) and it held her down and kept her productive for more than two weeks. With OpenOffice, it’s wonderfully easy. Besides, there’s always Google Documents!
The easiest way to do it up would be to add a secondary HD to your machine and use that for your chosen distribution for Linux. From there, you can learn and still play around while remaining productive with a Windows box.
Rob Said,
January 15, 2008 @ 1:34 pm
Is Ubuntu that great?
I have been wondering for a long time whether to get it or not.
I currently have Dell Inspiron 1100 with 2.4 Ghz Intel Celeron Processor and 512 MB of Memory.
I have about 30 Gb of storage with about only 9 GB free.
I mostly use General Office Application Word, Excel and Powerpoint, Dreamweaver, MSN, Yahoo and Google Chat, itunes, and Real Media, and Firefox and Thunderbird. With all these applications, my computer is running very slow. I am wondering whether Ubuntu would make the operation faster! Any info would be great.
Thanks for opening the Linux chapter Matt!
Dave (original) Said,
January 15, 2008 @ 9:45 pm
More RAM would be my 1st thought. Now-a-days 1GB of RAM is often the min needed.
Pushkaraj Said,
January 15, 2008 @ 10:23 pm
Dear Mat,
I have been struggling with a portable USB HDD for the past two days and I happened to see your very informative post. I installed gparted but still it does not work. What I really want to do is format the disk.
When I first attach the disk, (I am using using Ubuntu 7.10) it gives an error saying “Cannot mount volume”. However, like with any other well behaving external disk or a CD/DVD, it does open the file browser page to show that this disk has no data. In gparted, the menu option of ‘Partition’ does not show any of the submenus highlighted (resize/delete, format to, etc.)
What could be the problem? Please help !
Regards,
Pushkaraj
Pune, India
Leslie Said,
January 16, 2008 @ 1:59 am
Thanks Matt and everyone for the replies - I did not mean to sound like you should not be talking about what you want here - I read here because it is useful and you write well.
Thanks
Al Sefati Said,
January 16, 2008 @ 11:04 am
hardward…yikes!
Matt I have a question. I know its off topic but I would appreciate your response. How come google sometimes divides the SERP into multiple categories? what does that mean?
For example if you type in Soccer Nation in google, you will see what I mean.
Brian Said,
January 16, 2008 @ 11:32 am
@Dr. David Kline
I’m a longtime MS OS user (back to the MSDOS 2.x days) but I’ve enjoyed piddling around with various “flavours” of Linux this past year or so. The best advice one can give you is to download and burn a few “LiveCD” distributions. Just insert the LiveCD, reboot, and the whole OS will boot off the CD, leaving your Windows installation intact and untouched. The ordinary Ubuntu disk allows you to play around with the LiveCD while you’re installing the OS which gives you a bit of time to acclimatize to it in the mean time.
In truth, my own experience with Ubuntu (the last version I tried was Feisty Fawn - currently the next-to-newest release) was quite poor. I had some difficulty getting my hardware drivers installed and found it very frustrating to filter through the reams of user forums and FAQs that pertained to my hardware but for the wrong version of Linux. Also, I’m an avid gamer and most of my favourite software didn’t run properly or at all in Linux. Supposedly one can run MS Office just fine in Linux though I didn’t try.
I think Linux and specifically Ubuntu are getting to be very user-friendly, and they’ve already got more intuitive user interfaces than any other OS (I can’t wait to try the new KDE 4.0), but the window dressing is often only skin-deep. Many applications are much more complex and featureful than their watered-down UI allows, forcing users to delve into the scary command line. There’s somewhere between a plethora and cornucopia of free apps, but honestly I prefer the freeware on Windows.
Going 100% open source is a noble and extremely educational endeavour and I wish you luck. Give it a try, be patient, and have fun - it’s very rewarding. However, as “they” say, Linux is free if your time is worthless.
Rob Said,
January 16, 2008 @ 4:15 pm
Now, thats saying something Brian.
I will just reformat my ol’ PC and then get meself a new fancy hp tx1000z.
Boo me as you all may!?!?!
What about that dandy MacBook Air? Hardly a prize winner in my book.
Tim Wintle Said,
January 17, 2008 @ 2:03 am
dk, Rob - Ubuntu is great.
I’ve use Fedora Linux for as long as it has been around, and Red-hat Linux before that, but Ubuntu won me over recently as it’s so simple to use.
As with all Linux distributions there can be some problems with hardware (if the manufacturer doesn’t stick to standards and refuses to tell open source developers how to create drivers), but most things work without a hitch these days.
Rob, you said you use:
Word, Excel and Powerpoint, Dreamweaver, MSN, Yahoo and Google Chat, itunes, and Real Media, and Firefox and Thunderbird.
Ubuntu has:
Word -> open office
Excel -> open office
Powerpoint -> open office
Dreamweaver -> ? (I use bluefish, but I think you can run dreamweaver with WINE)
MSN -> Pidgin Internet Messenger (connects to msn)
itunes -> Rhythmbox (almost identical, but without the shopping)
and it has firefox and thunderbird (although I recommend Evolution over thunderbird).
Don’t know about real media, you can play real media, but I don’t know how to encode it.
For any of these things Linux is IMO easier to use than Vista or OSX, and it can be better looking, but for more technical things you need to start editing text file configuration settings. If you’re a standard computer user I would recommend Ubuntu.
There is also great support for ubuntu: see ubuntuforums.org
Rob Said,
January 17, 2008 @ 9:27 am
This spam protector math is so hard!?!?!
Thank you very much for the encouragement Tim and all the info. I will definitely try it once I have a new PC. As they say, don’t put all eggs in one basket!
Dave (The Other One) Said,
January 17, 2008 @ 2:30 pm
What a coincedence, I have the 1TB Seagate and I’m using it on my old laptop running Ubuntu (Edgy because it supports my wi-fi card). I have it setup to do daily backups of my production and client databases from my dedicated servers (which are running RHEL). Ubuntu is, in my opinion, the best flavour of Linux for the desktop user but I swear by RHEL for production servers.
mosh Said,
January 22, 2008 @ 11:51 am
Hey

IMO Ubunto it’s great OS
I’m not fan of Linux, I’m just WinXP user like most of other people
But few days ago i start my adventure with Ubuntu
Installation of this OS are soooo easy,
and during install Ubuntu we are connectet to Internet and we can surf
It’s much better then win installations….
The second matter is that after install Ubuntu on my notebook I have almost complete instalation (all drivers was instaled… I was must install only Nvidia diver)
So , I want say, Ubuntu rlz
win sux 
/
/sry for my english.. I just start learning this language
Afriend Said,
January 22, 2008 @ 8:29 pm
How can sites crawled by google request to stay in google results but also request you do not share there site information with anyone else without possibility of any penaly in SERPS or otherwise?
Afriend Said,
January 22, 2008 @ 8:45 pm
The object in picture - ” no idea and not interested ”
What I would be interested in is making basic seo available to the newcommers in this age of spam wouldn’t it do well to do some good to help people that are new with new ideas or do you guys just wanna promote spammy crap that pays you the money?
Richie Said,
January 23, 2008 @ 4:42 am
I bought a lap top from Packard Bell only for it to have problem after problem and even though it was still under warranty (at the time) they did nothing to help me out. So I gave up on it as it was going to cost too much for a new cpu and hard disk than it was worth.
A mate of mine had a look at it and said to install Linux on it as it didn’t need to resources that windows required, now I have another computer back thanks to the greatest of Ubuntu, I would recommend it to anyone for normal internet use, I now use Mac but it is a great little back up and as others have said there are plenty of great open source programs for Ubuntu.
And version 7.10 skin looks a little like Mac! A cheap way around having something that looks like Mac without the greatness of Mac!
I have now starting converting windows users that have bought brand new computers with Vista to Ubuntu.
Brian Said,
March 21, 2008 @ 11:16 am
Matt,
Thank you much for your help in turning off the STANDBY feature on the Seagate Free Agent Pro. I have a series of cron tasks that are supposed to routinely back up my data to a Seagate, and the spin down was a horrible nuisance.
On the other hand, I’m still pretty ignorant when it comes to hardware. Will disabling the IDLE and STANDBY options shorten the drive’s life significantly?
–Brian
Christian Einfeldt Said,
June 19, 2008 @ 2:47 pm
Hi Matt,
Thanks for this tip. Both the qparted tip and the 32label worked for me. The only thing I would add is that the user is going to need to change the permissions on the external hard drive to their user account if they are using Hardy, because Hardy set the ownership of my Iomega external hard drive as root. Some end users might not think of that. The symptom that I was experiencing was trouble writing to the external hard drive.
Thanks again, Matt!
Christian Einfeldt,
Producer, The Digital Tipping Point