Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Linux and Unix Linux and Unix
Search Search
Search for:
Tech Support Guy > > >

Installing Ubuntu to an external hard drive


(!)

AMW1's Avatar
AMW1 AMW1 is offline
Member with 10 posts.
THREAD STARTER
 
Join Date: Sep 2010
Experience: Intermediate
02-Mar-2011, 12:58 PM #1
Installing Ubuntu to an external hard drive
Iím trying to install Ubuntu to a 1Tb external hard drive, Iíve been struggling to do this or find info on how to do it. To make thing a little more complicated (and one of the reasons Iím struggling) is that there are a number of thing I want to do:
1. Partition the hard drive so that about 300Gb is the Ubuntu partition(s) the rest is a backup for my computer
2. I want to avoid any issues with GRUB/MBR
3. I only want to see the select operating prompt if the external HDD is attached (if the drive is attached and it boots strait to Ubuntu I can live with that).
4. Iíd also like to be able to run it on other computers and see the E drive of my laptop but these are not essential.
I am currently running Window 7 Home Premium 32bit (which I have the disk for) on a laptop.
Iíve been curious about running a Linux partition and using mostly free software on it and seeing how well it/they work, whether there any good and how easy it is to write documents and exchange them with most people running Microsoft programs before I consider a complete switch away from Microsoft .
Any help is appreciated thank you.
1002richards's Avatar
Computer Specs
Trusted Advisor with 5,196 posts.
 
Join Date: Jan 2006
Location: Sussex, UK
Experience: Intermediate
02-Mar-2011, 01:09 PM #2
Hi,
I dual boot Vista & Ubuntu on a laptop so can't help on the external drive scheme.

However, Ubuntu comes with OpenOffice which is compatible with Word, Excel etc. Some people are swapping that for LibreOffice which is also compatible with Word, Excel etc.

Here's one site that lists Linux alternatives to Windows progs
http://linuxappfinder.com/alternatives

Within Ubuntu you have access to the Ubuntu Software Centre (quote) "The Ubuntu Software Centre offers hundreds of games, including puzzles, adventures, tactical challenges and more. All free to choose and free to use."

A good read "Linux is not Windows" http://linux.oneandoneis2.org/LNW.htm

Hope this helps?
Richard

Last edited by 1002richards; 02-Mar-2011 at 03:21 PM.. Reason: Link!! and spelling!
saikee's Avatar
Member with 3,750 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
02-Mar-2011, 02:05 PM #3
My answers

(1) This is easy. Just click a terminal when running Ubuntu as a Live CD (to try it instead of installing it) and type
Code:
sudo
fdisk -l
cfdisk /dev/sdb
The "fdisk -l" will display all partitions of every hard disk. I am assuming device sdb is the external hard disk so issue the command cfdisk to partition it.

(2) No issue with Grub if you understand MBR is the first sector of a hard disk so you will have three choices of putting Ubuntu's Grub to (1) sda which will be your Win7 disk, (2) sdb which will be your external hard disk and (3) sdb1 the first 300Gb partition you create in device sdb.

(3) You have a dilema here. You have to allow the boot loader to display the Ubuntu even it is not bootable without the external disk attached. Win7 boot loader bootmgr, using Bios calls, is not known to boot system on a removable disk so you have to let Grub to sit in the MBR of sda. This is totally safe as Win7 MBR can be regenerated any number of times using a Vista/Win7 installation DVD.

As Grub needs its stage2 in booting so you have to install Grub onto the \boot directory of Win7. Ubuntu has Grub2 that can read a NTFS partition. Thus you can have Grub2 and Win7's bootmgr co-exist in the \boot. It works well but requires manually copy Grub2 files over from the external disk into the \boot directory of Win7. Thus you will have Grub2 in both the external disk as well as the Win7 internal disk. When the external disk is removed Grub2 can still work noirmally. The connection between sda MBR and the Grub2 in WIn7 \boot is made using the grub-install command when you run the Ubuntu.

(4) This you can do if

(i) Each other computer is capable of booting from a USB device
(ii) You have Grub2 installed in the MBR of the external disk sdb (in additional to it on sda)

I have moved the internal disk of Ubuntu between computers and the bugger fires up without any issue. In your case Ubuntu will boot as it uses UUID reference instead of the normal device name.

Last edited by saikee; 02-Mar-2011 at 02:11 PM..
DVOM's Avatar
Member with 1,690 posts.
 
Join Date: Jun 2002
05-Mar-2011, 09:03 PM #4
I have installed Ubuntu to a 8 Gig USB stick. When I did it, I installed Grub to the USB stick which kept the windows 7 bootloader so it would go straight to Win7.

All I needed to do to boot the Ubuntu USB was to hit F12 while powering up to get to the boot menu, choose USB and go from there. It would then go straight to Grub then Ubuntu.

If the USB Ubuntu stick wasn't plugged in, the machine would just boot straight to Windows.

I thought it was a fairly convenient setup.
saikee's Avatar
Member with 3,750 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
06-Mar-2011, 08:39 AM #5
Using the Bios to have a pre-fix booting order for the device is definitely simpler.

The OP has to amend the Grub menu if Windows were selected for booting though. The alteration involves altering the disk order on-the-fly but Grub can do that.
AMW1's Avatar
AMW1 AMW1 is offline
Member with 10 posts.
THREAD STARTER
 
Join Date: Sep 2010
Experience: Intermediate
08-Mar-2011, 10:16 AM #6
Iíve tried what saikee suggested but have fallen at the first hurdle, when I type the ďfdisk ĖLĒ command and I donít see anything and when I run the next command I get an error message Iíve included two screen shots to help.
Attached Thumbnails
Installing Ubuntu to an external hard drive-screenshot-1.png.jpeg   Installing Ubuntu to an external hard drive-screenshot-2.png.jpeg  
DVOM's Avatar
Member with 1,690 posts.
 
Join Date: Jun 2002
08-Mar-2011, 07:01 PM #7
I believe the Ubuntu Live CD comes with GParted for creating/manipulating partitions. That might be a little easier for someone who's not familiar with Linux.
jrbuergel's Avatar
jrbuergel   (Jim) jrbuergel is offline
Computer Specs
Member with 760 posts.
 
Join Date: Jan 2004
Location: Washington state
Experience: Intermediate
08-Mar-2011, 11:02 PM #8
To get that list of your hard drives partitions with the fdisk -l command, in Ubuntu be sure to type this; " sudo fdisk -l " and then give your password. So enter the sudo with that command on the same line, and not as a separate command.
saikee's Avatar
Member with 3,750 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
09-Mar-2011, 09:07 AM #9
Try copy and paste the commands I posted in Post #3.

If "sudo su" is issued first Ubuntu will change the user status to root after a correct password (for the user as there is not root password in a standard Ubuntu installation).

I favour "sudo su" because that is equivalent to a standard Linux command "su" outside the Ubuntu family. Ubuntu's approach is to supersede every command with "sudo" which seems to be different but it uses essentailly the same set of BASH commands of every Linux kernel. I have to admit that being a normal user and prefix every system-related command with "sudo" does increase the system security. However I also believe it is equally relevant that a Linux user familar with Ubuntu should be able to use any other Linux and vice versa so may be knowing the small difference of ubuntu from others would be helpful.

The "l" in "fdisk -l" is the lower case of "L".

Ubuntu will display nothing for "fdisk-l" to a normal user but to a root user the full information will be provided.

The reason I favour fdisk, which is a terminal command for partitioning only, and not gparted which is a GUI application because the latter combines partitioning with formatting in most of its applications.

To a new beginner to Linux or MS Windows it pays to know that partitioning and formatting are two different operations. The former is totally reversible (before the partition has been written on) and the latter is irreversible. The understanding of the two will benefit any PC user using a hard disk in general and in particular using more than one operating system on the same hard disk.

Last edited by saikee; 09-Mar-2011 at 09:16 AM..
AMW1's Avatar
AMW1 AMW1 is offline
Member with 10 posts.
THREAD STARTER
 
Join Date: Sep 2010
Experience: Intermediate
10-Mar-2011, 12:50 PM #10
Iíve got as far as getting all the commands working, I now just need to partition the drive and install Ubuntu. Iíve included screen shots to show you where Iím up to.
Just a side not to anyone trying this, the drive I was using was in NTFS I had to reformat the drive while running the Ubuntu live CD to FAT (donít try it in Windows as it does not work and you canít see the drive)
Also run the ďsudo fdisk ĖlĒ command before the ďsudo fdisk -l chdiskĒ command to check the name of the device first as mine was not sdb (see my previous screen shots).
Attached Thumbnails
Installing Ubuntu to an external hard drive-sudo-fdisk-l.jpg   Installing Ubuntu to an external hard drive-sdd1.jpg  
saikee's Avatar
Member with 3,750 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
10-Mar-2011, 02:49 PM #11
OK your second screen shot confirms that sdd now is empty. You can use fdisk to create partitions for Ubuntu installation. In your case I would recommend cfdisk instead of fdisk as the former is more user-friendly but the latter is very powerful if you know how to use scripts.

Use this command to partition sdd
Code:
cfdisk /dev/sdd
you then create sdd1 say size 1Gb and type 82 for swap and then sda2 with say 50 to 100Gb for Ubuntu. Any partition you create with a Linux partitioning tool will default to Type 83 which is native to Linux. You only need to change Type for swap, NTFS or Fat.

As a rule all "terminal" partitioning tools in Linux only do partitioning. This is to define the boundary of the partitions but the created partitions have no filing system inside. A partition without a filing system inside cannot be mounted regardless it is in Linux , Dos or MS Windows. You need to format the partition before it can be mounted.

For installation there is no need to format the partition itself. Leave this to the installer. In fact many installers do trust the user and would reformat it regardless. Traditionally it is an installer's duty to reformat the partition so go with the flow. A MS Windows for example will do it without asking the user.

Thus after the partitions sda1 and sda2 have been created to put Ubuntu into sda2 just click the installer which is visible in the desktop screen. In its disk partitioning section you select the option to choose your own arrangement. Ubuntu will then present the partitions suitable for its installation and that should be sda2. You then highlight it, select to format it in Ext4 filing system and mount it as /.

The installer will then put Ubuntu inside sda2 and configure it to use sda1 because it is recognised by every Linux as swap. Some distros, like the Slackware family may ask your permission to use the sda1 as swap but Ubuntu will do it automatically without consulting you.

Last edited by saikee; 10-Mar-2011 at 02:54 PM..
AMW1's Avatar
AMW1 AMW1 is offline
Member with 10 posts.
THREAD STARTER
 
Join Date: Sep 2010
Experience: Intermediate
17-Mar-2011, 12:44 PM #12
Iíve got the grey partition screen up Iíve entered the sizes of the partitions but when I write the partitions I get the message
Wrote partition tables, but reread failed.
The installer is also not seeing the partitions
Iíve included a screen shot if it helps
Attached Thumbnails
Installing Ubuntu to an external hard drive-screenshot.png  
saikee's Avatar
Member with 3,750 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
17-Mar-2011, 03:01 PM #13
In partitioning use the standard device name like sdd1, sdd2 etc and let the system generates them.

If you want a trouble free installation just write the partition table, exit, do a reboot so that the kernel can detect the new partition table..
AMW1's Avatar
AMW1 AMW1 is offline
Member with 10 posts.
THREAD STARTER
 
Join Date: Sep 2010
Experience: Intermediate
04-Apr-2011, 02:06 PM #14
Whatever I did last time I rely made a mess of it, when I try to run the cfdisk I get the error
Fatal error: bad partition 0: partition ends in the final partial cylinder
I tried to reformat the disk in window (quick and long) and in Ubuntu, I deleted the volume using windows disk manager with no luck.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
external hard drive, grub, installing, mbr, ubuntu

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑