LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-16-2015, 05:37 PM   #1
WisdomFire
LQ Newbie
 
Registered: Aug 2014
Location: Pacific Northwest of the US
Distribution: Manjaro 16.06, Slackware 14.1
Posts: 10

Rep: Reputation: 0
External hard drive Slackware bootup partitioning? (14.1/current?)


So, I am thinking about turning a part of my external hard drive (Toshiba 1TB USB3.0) into a Slackware 14.1 bootable drive for a testing arena for new DE's, programs, projects and whatnot. Also, with the hard drive being nice and portable (and USB3.0), I intend to take this around and show off my testing and system to other people.

Now, I already have Slackware 14.1 (x86_64) already installed on my Laptop (uber fast 128GB SSD for only $60-ish), so that is no issue. I personally use BTRFS, but could also use EXT# as I have had a bit of exp. with EXT2 and EXT4. I also intend for this to be used rather infrequently, and not a 365-day per year boot-up. Just for testing out some new softwares (especially DE's and some "pet-games" as I would call them.)

Now, enough of the intro. The whole issue here is that I want to keep a FAT32 partition (~700GB) on there to transfer all my files between my computer, my Mom/Grandparent's/Everybody else's Windows PCs and my Dad's/my Slackware computer, Backup, etc... Anyway...

First off, would it be feasible to do this? Would I have no issues with Windows and a bootable drive on the same device? Second off, what exactly would I do. I know the general idea of it and partitioning out a new drive for my own computer, but IDK about this...

Thnx for your help. I have already ruined a 32GB Flashdrive (~$25) trying to do this, don't ask me how. I'm guessing it is a whole slew of things. X'D

(PS: As detailed as possible is really nice, because I am a bit more paranoid now that I ruined another device...don't ask. )
 
Old 12-16-2015, 06:22 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,537

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
It would certainly be possible to have a windows partition and a separate Slackware partition. When you install Slackware, just install Lilo (or Grub if you use it) to the MBR of the external drive. Make sure you get the correct drive. Not sure why you would want FAT32 rather than ntfs. Should not make any difference whether you install Slackware first and then create a windows partition or do the reverse but installing Slackware first might be easier if you are unfamiliar with partitioning. I don't know why you think this would think this would be a problem.

Last edited by yancek; 12-16-2015 at 06:25 PM.
 
1 members found this post helpful.
Old 12-16-2015, 06:44 PM   #3
WisdomFire
LQ Newbie
 
Registered: Aug 2014
Location: Pacific Northwest of the US
Distribution: Manjaro 16.06, Slackware 14.1
Posts: 10

Original Poster
Rep: Reputation: 0
See the paranoia part. I honestly don't know how, but I have ruined multiple flashdrives, and this last one was pretty expensive (I normally buy USB2 not 3). I do want to be careful with this one. TBH, I think it died in attempting to boot. Spat out some error and died. Well, whatever. It was my fault for probably doing something stupid and there is no recovery (unless there is some black-magic involved XD ).

Also, is NTFS compatible with XP/Vista? Kinda need that. I need to be able to bridge all the OS's I am stretched across.

[Edit]

Quote:
So would it be best (read:easiest) just to format it (in my case, to a BTRFS fs), make bootable, install/configure everything, and then partition off a FAT32 (or maybe NTFS) part? I am more familiar with the install on things like the raspberry-pi with slackware-arm. Not having to do with anything external. I am guessing it is the same, but I don't know.
Scratch that. After looking it all over again, and clearing out my head, how would I install LILO to the MBR of my eHDD?

[/Edit]

Anyway, I will be a lot more clear-headed after finals and all that 'school-stuff', and I probably should only try this during winter-break.

Last edited by WisdomFire; 12-16-2015 at 07:47 PM.
 
Old 12-16-2015, 09:43 PM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
Maybe you did not really ruined your flash drives, but just erased the MBR/GPT, making them tentatively unusable. I write "tentatively", because when that happens it is generally easy to just zero the boot sector and rebuild a partition table.

To find out, please plug in, one at a time, each flash drive that you own, even if you consider it ruined, wait say 30 seconds for it to settle and type this command on Linux:
Code:
lsblk -o model,name,size,type,fstype
and posts the results here for each flash drive. if you see one of these devices in the output, even as a disk with no partition, probably all is not lost. Then, we will give you instructions how to make them usable again.

Last edited by Didier Spaier; 12-16-2015 at 09:46 PM.
 
1 members found this post helpful.
Old 12-16-2015, 09:53 PM   #5
WisdomFire
LQ Newbie
 
Registered: Aug 2014
Location: Pacific Northwest of the US
Distribution: Manjaro 16.06, Slackware 14.1
Posts: 10

Original Poster
Rep: Reputation: 0
Hmmmm. Black magic time it appears... XD

Code:
 USB Flash Drive  sdb      29.9G disk vfat
Probably the part you are interested in

The others I don't really care about. They were 4GB USB2 and they are laying around buried somewhere and I don't want to find them. They were a set of 20 on ebay for about $15-ish

EDIT: This is the 32GB one I spoke of.

Last edited by WisdomFire; 12-16-2015 at 09:57 PM.
 
Old 12-16-2015, 10:10 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
OK, then:

  1. plug it in and retype the command to check that it bears the same name (to make sure that you are not going to loose all data on another device...)
  2. Assuming that the device name is still sdb, type this to wipe its boot sector:
    Code:
    dd if=/dev/zero of=/dev/sdb bs=512 count=1
    EDIT: I first I wrote /dev/sdx. In your case it should be /dev/sdb or whatever the output of lsblk gives you.
  3. Create your new partitions on the USB drive with cfdisk, fdisk, gdisk, cgdisk, gparted, parted, whatever.
  4. Put in each of the partitions you just formatted a filesystem consistent with the partition type.
If you are unfamiliar with the commands to type and the underlying concepts you will probably be more comfortable performing steps 3) and 4) with a graphical tool like gparted live.

PS never buy too cheap or used USB drive unless you do not care about the data you will put on it. But then, why store these data?

Last edited by Didier Spaier; 12-16-2015 at 10:16 PM. Reason: PS added.
 
2 members found this post helpful.
Old 12-16-2015, 10:27 PM   #7
WisdomFire
LQ Newbie
 
Registered: Aug 2014
Location: Pacific Northwest of the US
Distribution: Manjaro 16.06, Slackware 14.1
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Didier Spaier View Post
OK, then:

  1. plug it in and retype the command to check that it bears the same name (to make sure that you are not going to loose all data on another device...)
  2. Assuming that the device name is still sdb, type this to wipe its boot sector:
    Code:
    dd if=/dev/zero of=/dev/sdb bs=512 count=1
    EDIT: I first I wrote /dev/sdx. In your case it should be /dev/sdb or whatever the output of lsblk gives you.
  3. Create your new partitions on the USB drive with cfdisk, fdisk, gdisk, cgdisk, gparted, parted, whatever.
  4. Put in each of the partitions you just formatted a filesystem consistent with the partition type.
If you are unfamiliar with the commands to type and the underlying concepts you will probably be more comfortable performing steps 3) and 4) with a graphical tool like gparted live.

PS never buy too cheap or used USB drive unless you do not care about the data you will put on it. But then, why store these data?
Thank you sooooo much. I had absolutely no idea what to do with it, and this has resurrected my flashdrive. Black-magic... I do know what to do from here, and am comfortable enough with cfdisk.

Also, the cheap 4GB ones do work. However, the 2 I crashed had a very similar error, because I suppose I was doing something weird with BTRFS, which was still more or less completely experimental at that time. The others (well, I've only really used 7ish plus the two "dead" ones or so, but the rest) should (hypothetically) work. And plus, 4 or so were for data transfer, and the rest were data storage for tinkering projects I didn't want on my computer. I only have a 128GB SSD, and am not in the best of financial straits, especially as a student. Ahhh well. Life goes on.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Back to the original question I had, is installing LILO on a MBR really any different for an /dev/sdb(c/d/...) drive instead of the local dev/sda drive? (this is how I have set my slackware up in this case...)

Last edited by WisdomFire; 12-17-2015 at 09:26 PM.
 
Old 12-17-2015, 01:08 AM   #8
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591

Rep: Reputation: 73
partitioning is not a question there, imho.
the question, who i not solved yet, in situation when you make bootable system on external drive -how it boot and mount local ( also root) partition.
bnecause on one system your external drive turns out as sdb, on other - sdc, on third - it may be sdd.
last time, when i try make lilo understand a uuid, it not work....
 
Old 12-17-2015, 07:42 AM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by WiseDraco View Post
last time, when i try make lilo understand a uuid, it not work....
It is certainly possible to use UUID (and you're right in that it would need to be used in this case since the drive mappings would likely change on different computers). He'll need to have both /etc/lilo.conf and /etc/fstab converted to UUIDs (or labels, but UUIDs are more likely to be unique). See my post here on what needs to be done to use UUID in your lilo.conf (and your fstab -- this should be a complete solution to switch your system to UUID).

Quote:
Originally Posted by WisdomFire View Post
Also, is NTFS compatible with XP/Vista? Kinda need that. I need to be able to bridge all the OS's I am stretched across.
Yup, it will work fine. NTFS was first introduced to the consumer market with Windows XP (previous commercial-grade versions of Windows had it as well), so every version of Windows since Windows XP includes NTFS support (and uses it by default). NTFS is also well supported in Slackware with the NTFS-3G driver (in your /etc/fstab, use ntfs-3g as the filesystem type). NTFS has a number of advantages over FAT32 including: files larger than 4GB, permissions, better recovery of errors, and probably lots more. I would also recommend formatting that NTFS partition in Windows. Linux supposedly has support for formatting NTFS, but everytime I've tried it, Windows has been unable to read it. Formatting it in Windows has always allowed both Windows and Linux to read and write to the drive without issues.

And writing to the MBR using lilo will work fine no matter if the drive is internal or external. It all depends on what drive you set as your boot drive in your lilo.conf. That will be where the MBR will be written. See the guide I linked above on what you need to do to swap your fstab and lilo.conf over to UUIDs. You will need that if you want to boot it on multiple systems (since the external might be /dev/sdb on your system, but it might be /dev/sdd on another, which will cause a kernel panic unless everything is referenced by UUID).
 
2 members found this post helpful.
Old 12-18-2015, 06:00 PM   #10
WisdomFire
LQ Newbie
 
Registered: Aug 2014
Location: Pacific Northwest of the US
Distribution: Manjaro 16.06, Slackware 14.1
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bassmadrigal View Post
It is certainly possible to use UUID (and you're right in that it would need to be used in this case since the drive mappings would likely change on different computers). He'll need to have both /etc/lilo.conf and /etc/fstab converted to UUIDs (or labels, but UUIDs are more likely to be unique). See my post here on what needs to be done to use UUID in your lilo.conf (and your fstab -- this should be a complete solution to switch your system to UUID).



Yup, it will work fine. NTFS was first introduced to the consumer market with Windows XP (previous commercial-grade versions of Windows had it as well), so every version of Windows since Windows XP includes NTFS support (and uses it by default). NTFS is also well supported in Slackware with the NTFS-3G driver (in your /etc/fstab, use ntfs-3g as the filesystem type). NTFS has a number of advantages over FAT32 including: files larger than 4GB, permissions, better recovery of errors, and probably lots more. I would also recommend formatting that NTFS partition in Windows. Linux supposedly has support for formatting NTFS, but everytime I've tried it, Windows has been unable to read it. Formatting it in Windows has always allowed both Windows and Linux to read and write to the drive without issues.

And writing to the MBR using lilo will work fine no matter if the drive is internal or external. It all depends on what drive you set as your boot drive in your lilo.conf. That will be where the MBR will be written. See the guide I linked above on what you need to do to swap your fstab and lilo.conf over to UUIDs. You will need that if you want to boot it on multiple systems (since the external might be /dev/sdb on your system, but it might be /dev/sdd on another, which will cause a kernel panic unless everything is referenced by UUID).

Alright, I will give this a try. I am on Winter break now, so I have time. Thank you
 
Old 12-19-2015, 02:59 AM   #11
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 900

Rep: Reputation: 153Reputation: 153
I have an external, 250gb, drive that boots to Slackware 14.1 using an ext4 filesystem with partitions for /root, /home and swap can't see why an extra partition should be a problem as long as you don't overwrite it!

Looking at my notes I did something like this-

Install Slackware to the external drive - don't shutdown or reboot, don't install grub2 or lilo
The new installation will be mounted on /mnt so chroot to it

Code:
chroot /mnt
mount /proc
Use uuids in fstab. You might want to break the following into manual steps. Just make sure you take a backup of fstab and inspect the final results

Code:
cd /etc

#Make a backup of fstab
cp -p fstab fstab.$(date +"%Y%m%d.%H%M%S").bak

#Substitute the device names for uuids in fstab 
cat fstab | while read line
do
EDIT_STRING=$(blkid -n ext4  $(echo $line | awk '{print $1}') | awk '{print "s~"$1"~"$2"~"}' | tr -d ":" )
if [[ ! -z $EDIT_STRING ]];then
echo $EDIT_STRING
sed -i "$EDIT_STRING " fstab
fi
done

# see what's changed in fstab 
diff fstab.bak fstab
#The expected results from the diff should look similar to this -

Quote:
Expected results -
1,3c1,3
< /dev/sda3 swap swap defaults 0 0
< /dev/sda1 / ext4 defaults 1 1
< /dev/sda2 /home ext4 defaults 1 2
---
> UUID="aa087dd0-30ab-420d-ad3e-119de4f146df" swap swap defaults 0 0
> UUID="13cba24e-ff83-48fc-9dc8-2a6954161c10" / ext4 defaults 1 1
> UUID="f9f96609-75ca-4086-ba54-328f715772c3" /home ext4 defaults 1 2





build an initrd, from what I remember the important bit here is "-w 10" you need to give time for your machine to recognise the external drive.

Code:
cd /boot
mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/sdb1 -m usb-storage:xhci-hcd:ehci-hcd:ehci-pci:uhci-hcd -u -w 10 -o /boot/initrd.gz

I use grub so configure grub2, if you use lilo swap in the standard lilo instructions here

Code:
cd /boot
grub-install $(df -h . | tail -1 | cut -c1-8)
grub-mkconfig > /boot/grub/grub.cfg

exit chroot

and reboot machine. Hopefully if you're bios allows it it will boot of the external drive
 
  


Reply

Tags
bootable, compatability, external hdd, fat32, slackware 14.1



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware 13 does not see my external usb hard drive zeelog Slackware 14 08-06-2012 12:43 AM
Installing Slackware 11.0 to External Hard Drive shadin Slackware 5 05-13-2007 03:57 AM
ubuntu partitioning tool does not see external usb hard drive when installing ubuntu fakie_flip Linux - Software 2 07-30-2006 12:44 AM
need some help partitioning a large (250GB) usb external hard drive vees Linux - Hardware 2 07-04-2006 04:14 AM
Installing Slackware 9.1 on external hard drive? gene69 Linux - Newbie 1 09-18-2005 07:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration