Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-06-2012, 02:00 AM
|
#1
|
|
Member
Registered: Jun 2004
Distribution: Slack x86 current
Posts: 120
Rep:
|
Manually assign a device name to a specific HDD
Hi all
I have a PC that I use to clone HDDs, recover and copy data, ecc ecc.
The PC has slackware installed onto an IDE drive. Normally I work on SATA drives so I'm happy to have the OS on the IDE hdd so I have all SATA ports free.
But I have a problem: the IDE drive always gets the last letter after all the sata disks. If it's the only one it becomes sda, with 1 sata disk becomes sdb, with 2 sata disks sdc and so on.
Of course I get a kernel panic on every boot until I pass 'mount root=/dev/sdx' option each time to lilo with the actual IDE drive name
So I would like to stick manually a name to the disk so it will always be /dev/sda (or /dev/sdz or /dev/drivewithacustomname ) so I don't have more troubles on every boot.
I always tried to play with /dev/root (telling lilo to boot from /dev/root ) in various attempts, but without any result (I think that beacuse /dev/root is a symlink and lilo uses the link target, that will change moving drives)
Any hint??
Thank you all
Bye
Alessandro
|
|
|
|
09-06-2012, 03:26 AM
|
#2
|
|
Member
Registered: Jan 2008
Posts: 64
Rep:
|
You can try to assign label to your Slackware root partition, for ex. swroot
Code:
e2label /dev/sda1 swroot
, and then pass it instead of device name to kernel as in LILO prompt or as
Code:
root = "LABEL=swroot"
in /etc/lilo.conf. Note, that any changes in lilo.conf require to run lilo.
Does it help?
Last edited by bormant; 09-06-2012 at 03:41 AM.
Reason: lilo.conf syntax
|
|
|
|
09-06-2012, 04:16 AM
|
#3
|
|
Member
Registered: Jun 2004
Distribution: Slack x86 current
Posts: 120
Original Poster
Rep:
|
Great idea!
I'm trying. I've labeled the root partition and the swap partition
Then I've edited lilo.conf and fstab telling them to use labeled partitions.
But I can't boot the system. I also tried to pass the option to lilo (Linux mount root=label=slackware), no way.
But if I pass mount root=/dev/sda2 the system boots correctly, and mounts root and swap partitions, so the labeling and syntax used in fstab both works.
But I can't tell to lilo to use labels ... now I do some other tests..
|
|
|
|
09-06-2012, 04:40 AM
|
#4
|
|
Member
Registered: Jun 2009
Distribution: Slackware
Posts: 103
Rep:
|
You can use UUIDs. They are unique to every partition.
Code:
ls -l /dev/disk/by-uuid
will give you UUIDs of your disks.
Then, you can use them in fstab and lilo.conf.
fstab:
Code:
UUID={YOUR-UID} {/path/to/mount/point} {file-system-type} defaults 0 1
But, it seems that you have to have initrd for this to work.
This should be helpful:
http://nil-techno.blogspot.com/2012/...s-by-uuid.html
|
|
|
|
09-06-2012, 05:39 AM
|
#5
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,784
|
I add to what diwljina wrote that the "blkid" command will give you the file types in addition.
And using an initd is not mandatory.
|
|
|
|
09-06-2012, 06:10 AM
|
#6
|
|
Member
Registered: Jun 2004
Distribution: Slack x86 current
Posts: 120
Original Poster
Rep:
|
No way
Always get kernel panic
I'm not using an initrd
But I can see a strange behaviour: on the kernel panic screen, I can see the list of all drives and partitions, each one has an hex code with a structure similar to an UUID, but this codes are DIFFERENT from the ones seen by blkid, and for the IDE disk these codes are 00000000-0000-0000-0000-00000000000 for both partitions ..
I don't know if this may help..
Thank you for yout effort, I'll go trying other options...
|
|
|
|
09-06-2012, 07:37 AM
|
#8
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,784
|
You may just need to allow a delay before your SATA disk become available.
In the relevant stanza of lilo.conf add:
Code:
append = "rootdelay=30"
Of course adapt as needed, 30 means 30 seconds.
Last edited by Didier Spaier; 09-06-2012 at 07:46 AM.
|
|
|
|
09-06-2012, 10:38 AM
|
#9
|
|
Member
Registered: Jan 2008
Posts: 64
Rep:
|
Quote:
Originally Posted by Barx
Linux mount root=label=slackware
|
Please, try this literally at LILO prompt:
Code:
Linux root="LABEL=slackware"
Does it help?
ps.
/usr/src/linux/Documentation/kernel-parameters.txt says to see about kernel root= parameter name_to_dev_t comment in init/do_mounts.c.
This comment says nothing about "LABEL=", so it is initrd sripts magic. It also says that PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF accepted by kernel itself but if partition table provides it.
Last edited by bormant; 09-06-2012 at 10:56 AM.
Reason: About PARTUID=
|
|
|
|
09-07-2012, 12:01 PM
|
#10
|
|
Member
Registered: Jun 2004
Distribution: Slack x86 current
Posts: 120
Original Poster
Rep:
|
Thank you all fro your efforts.
Sorry but today I was out of office and I had no time to test, I'll restart testing this monday
I'll try to deal with rootdelay, but I don't think this will fix because using the device name like /dev/sde1
here you can find the relevant parts of my testbed, just to view if something is wrong
partition labels and UUIDs:
Code:
root@server:~# blkid
/dev/sde1: UUID="c347c1e4-e49f-4b7b-914d-b8f681c03428" TYPE="swap" LABEL="slackswap"
/dev/sde2: LABEL="slackware" UUID="8563d7da-09d8-4956-a6a4-77e2e3eb341e" TYPE="ext4"
fstab (perfectly working):
Code:
LABEL=slackswap swap swap defaults 0 0
LABEL=slackware / ext4 defaults 1 1
lilo.conf
Code:
image = /boot/vmlinuz
# root="LABEL=slackware"
# append = "root=UUID=8563d7da-09d8-4956-a6a4-77e2e3eb341e"
# append = "root=LABEL=slackware"
label = Linux_test
read-only
I tried the three commented line (only one for time) without results
Monday I will do further tests
Thank you all
Alessandro Barisone
Last edited by Barx; 09-07-2012 at 12:02 PM.
|
|
|
|
09-07-2012, 03:28 PM
|
#11
|
|
Member
Registered: Sep 2009
Location: Ireland
Distribution: Slackware64, NetBSD
Posts: 400
Rep: 
|
Quote:
Originally Posted by Barx
here you can find the relevant parts of my testbed, just to view if something is wrong
partition labels and UUIDs:
Code:
root@server:~# blkid
/dev/sde1: UUID="c347c1e4-e49f-4b7b-914d-b8f681c03428" TYPE="swap" LABEL="slackswap"
/dev/sde2: LABEL="slackware" UUID="8563d7da-09d8-4956-a6a4-77e2e3eb341e" TYPE="ext4"
fstab (perfectly working):
Code:
LABEL=slackswap swap swap defaults 0 0
LABEL=slackware / ext4 defaults 1 1
|
This is how your fstab should look with UUIDs:
Code:
UUID=c347c1e4-e49f-4b7b-914d-b8f681c03428 swap swap defaults 0 0
UUID=8563d7da-09d8-4956-a6a4-77e2e3eb341e / ext4 defaults 1 1
When you specified UUIDs in your fstab did you perhaps neglect to remove the quotation marks around them?
|
|
|
|
10-29-2012, 03:43 AM
|
#13
|
|
Member
Registered: Jun 2004
Distribution: Slack x86 current
Posts: 120
Original Poster
Rep:
|
OK it works!
initrd is required to do the trick. I think that the label (or UUID) is seen only if the module for the root file system is loaded via initrd.
I've used a 'simple' initrd containing only ext3 module (the one used for root file system in my testbed) created with
Code:
mkinitrd -c -k 3.2.29 -m ext3 -f ext3 -r /dev/sda1
then added this line
Code:
append = "root=LABEL=slackware"
(put in the correct lilo entry, not in common section)
and now system boots perfectly!
Thank you all for your help!
Last edited by Barx; 10-29-2012 at 03:45 AM.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:41 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|