Portable MEPIS on USB hard drive
From MEPIS Documentation Wiki
If you would like to create a "Portable" version of MEPIS on a USB hard drive, this entry will give you help in doing that. The goal is to create a bootable version of MEPIS on an external USB hard drive that can be used on a variety of computers without reconfiguring or disturbing the previously installed Operating Systems.
For example, you may have a corporate/work laptop with Windows installed but want to use your own personalized MEPIS Linux when you are traveling - without repartitioning or disturbing the Windows install on the work laptop. By installing MEPIS on a small, external USB hard drive and then configuring the target computer's BIOS to boot first from USB, MEPIS Linux can boot first and give you use of the work computer's hardware without touching Windows.
Note: MEPIS 8 has the capability to install a bootable version of MEPIS on USB keys or flash drives, and USB hard drives, but it will only install the LiveCD, not a fully modifiable and personalized version of MEPIS. Putting LiveCD on a USB hard drive or flash drive is handy for installing MEPIS on machines with no CD ROM drive, but it will not let you create new user accounts and make other changes. These instruction are meant give you the ability to create a fully customizable install of MEPIS 8.
Installing MEPIS 8 on the USB Hard Drive
These instructions are specific to MEPIS 8 and seem to work fine on MEPIS 8 RC2, but have not been tested and may not work on MEPIS 7.
- Partition and format the USB hard disk. Plug the USB hard disk into an existing MEPIS 8 machine. Leave it unmounted, or click on "Do Nothing" when the dialog box appears. Next, use gparted (System-->File System-->Partition Editor) to create three partitions (replace sdx with the correct label for your system):
- sdx1 formatted for ext3 (to be used for root), make it >= 9.74 GB
- sdx2 formatted for linux-swap, make it >=1004 MB
- sdx3 formatted for ext3 (to be used for /home). make it whatever is left over -or-
- create a 4th partition, say sdx4 formatted for ntfs for other stuff
- Boot a machine with LiveCD, plug in the newly partitioned USB hard disk, leave it unmounted again, and run the MEPIS Installer. Choose "install to existing partitions", using the partitions you created, and when it asks to install MBR make sure you select the USB hard drive because MEPIS Installer defaults to using the primary hard drive of the machine you have booted LiveCD from.
Making the MEPIS 8 USB Hard Drive Bootable from any Machine
This is probably the most important step. Why? Because each machine you boot your Portable MEPIS from the USB hard drive, the target machine may mount the USB hard drive differently. In other words, the target machine may assign different /dev/sdxx designations to your USB hard drive and your Portable MEPIS will not boot correctly. To avoid that problem, you must identify the UUID for the partitions you have created and hard code those into the /boot/grub/menu.lst and the /etc/fstab files as follows:
- 1. Use the command ls -lF /dev/disk/by-uuid via console to show the UUIDs assigned. Note: make sure you use a lowercase "L" for the "-l" part. Alternatively, you can also use the command blkid to show the UUIDs.
Using ls -lF, the result should look like this (UUIDs are bolded):
lrwxrwxrwx 1 root root 10 2009-02-06 22:53 0E6EFBDC72DF3EA7 -> ../../sdc4 lrwxrwxrwx 1 root root 10 2009-02-06 06:01 26448423-1579-447c-abc4-ad8a91773e19 -> ../../sdb1 lrwxrwxrwx 1 root root 10 2009-02-06 22:53 70d10a5e-7165-40ee-b6a0-c71a788b3fd0 -> ../../sdc3 lrwxrwxrwx 1 root root 10 2009-02-06 22:53 8c36af72-5952-4dd6-b225-6568d12e7a37 -> ../../sdc1 lrwxrwxrwx 1 root root 10 2009-02-06 06:01 8f031964-3f96-434b-a2bb-e98f57c76d4a -> ../../sda1 lrwxrwxrwx 1 root root 10 2009-02-06 06:01 b392ac92-2067-4017-a62a-53e50057ff07 -> ../../sda2 lrwxrwxrwx 1 root root 10 2009-02-06 06:01 c34a9e00-25e6-4fc3-b8fa-a1a4b72126df -> ../../sda3 lrwxrwxrwx 1 root root 10 2009-02-06 22:53 f05d13f9-412b-4844-a770-393ab4852826 -> ../../sdc2
Note that in my case, I created 4 partitions, that were assigned sdc1, sdc2, sdc3, sdc4 because I plugged my USB hard drive into a computer with 2 existing hard disks, sda and sdb. In my case, sdc1 is where I have MEPIS installed, so I need to change two files on the USB hard drive to reflect that: /etc/fstab and /boot/grub/menu.lst. In each file, I need to replace /dev/sdx with UUID=#########.
- 2. Edit fstab. For example, change the appropriate line in /etc/fstab:
/dev/sdb1 / ext3 defaults,noatime 1 1
UUID=8c36af72-5952-4dd6-b225-6568d12e7a37 / ext3 defaults,noatime 1 1
- 3. Edit /boot/grub/menu.lst
Your resulting menu.lst stanza should look something like this with ####### replaced with your UUIDs:
title MEPIS at sdc1, newest kernel root (hd0,0) kernel /boot/vmlinuz root=UUID=######## nomce quiet splash autox rootdelay=10 initrd /boot/initrd.img boot
Note: I have removed the usual resume= in the kernel entry for menu.lst based on the advice of those experienced with using USB hard drives. Suspending with a portable USB hard drive is not recommended as it can be finicky, depending on hardware, and each set of hardware will be different. To be on the safe side, a clean shut down is recommended, without ever using suspend.
- 4. Safely remove the USB hard drive. Set the BIOS of your target computer to boot from USB first, then, Hard Disk, and you should then be able to boot MEPIS from your USB hard drive.