LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-11-2015, 02:47 PM   #1
SiriD
LQ Newbie
 
Registered: Dec 2015
Posts: 15

Rep: Reputation: Disabled
Smile I've a problem with fstab


I'll try to do my best explanation, in fact, I always use 3 partitions on linux, one is for /, another for swap and the third is for home, in others distributions i only edit the fstab adding a new line with the uuid=(number) /home ext4 defaults 0 2, but tonight i decided beginning in slackware, and when i want to change the fstab result that is totally different to the others distribution of linux, that fstab doesnt has to add the UUID from a new /home, i dont know if the LILO is my problem, so i need your help, i'll be very grateful with you!
 
Old 12-11-2015, 02:52 PM   #2
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
I've a problem with fstab

UUID is an option to identify a partition, not the only one. What were you trying to fix? Didn't you choose the partition scheme at the install?
 
Old 12-11-2015, 03:08 PM   #3
SiriD
LQ Newbie
 
Registered: Dec 2015
Posts: 15

Original Poster
Rep: Reputation: Disabled
Ok i want this:

I've those partitions:

/dev/sda1 Windows
/dev/sda2 Slackware
/dev/sda3 Swap
/dev/sda4 This is a ntfs partition, here i have all my data from windows and linux,

i need to configure sda4 partition how the new /home of slackware, before i did it since fstab copying the uuid of sda4 from blkid and add it in fstab. but i couldn't do it now, i need help with it.
 
Old 12-11-2015, 03:21 PM   #4
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
By default, Slackware will just use the drive mappings (/dev/sda2, /dev/sdb1, etc). UUIDs are not normally needed for most setups, and they can make it harder to understand what the fstab is doing for newer users.

But, there are definitely some setups where UUIDs are preferred (mine is one of them). UUIDs are unique to each partition and are generated every time you format the drive. If your mappings change when you plug in a thumbdrive, switch around hard drives, etc, then UUIDs are probably preferable to the drive mappings since they'll always point to the correct mapping, even if that has changed since your last reboot. They are also extremely handy to use for external devices (if you don't know if you're thumbdrive will be /dev/sdg or /dev/sdk since it changes all the time, you could reference it by its UUID). I switch my harddrives around a lot, and so it is much easier for me to just reference the UUID rather than try and remap all the mappings when they have changed.

If you want to switch to UUID in your fstab, you can easily do it by finding the corresponding UUID of the various mappings that are in there. Personally, I just use ls -la /dev/disk/by-uuid, but I know you can also use lsblk if you throw some arguments at it. You would just need to replace your "/dev/sda1" with "UUID=whatever-the-uuid-is" and leave the rest the same. Here's my fstab (I like everything to line up)

Code:
####### SSD ######
UUID=bc4538e5-9387-4e5c-877b-d15744acb6ce       swap                            swap            defaults,discard                0   0
UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d       /                               ext4            defaults,noatime,discard        0   1
UUID=226f1db3-2f14-4862-9998-8be1e8f7cdc9       /home                           ext4            defaults,noatime,discard        0   2

###### HD ######
UUID=cd554cf8-c346-4bd5-ba6a-84ac99af571f       /share/movies                   ext4            defaults                        0   2
UUID=cae38214-71f3-4678-bf78-3e836e7a4022       /share/TV/completed             ext4            defaults                        0   2
UUID=ebdab491-caf6-4ae7-9672-67ed3bb3d665       /share/TV/ongoing               ext4            defaults                        0   2
UUID=5f466dd0-2434-46ba-a276-6eee7647da9d       /share/music                    ext4            defaults                        0   2
UUID=2ef6e776-c2eb-4e56-bc7e-dfe083559d8f       /share/gothrough                ext4            defaults                        0   2
Now, if you have a reason other than preference to move your fstab to UUIDs, you should probably move your /etc/lilo.conf to UUIDs as well, because if the root drive changes, your kernel will panic on boot and you won't finish the boot process.

First, you'll need to change the boot drive to the disk ID (the drives themselves don't have UUIDs, only individual partitions, so if you don't want to reference it as /dev/sda, you'd need the disk's ID). To get the ID, you just check ls -la /dev/disk/by-id and match up the boot drive (you should see additional part1, part2, part3, etc for each partition on the drive, but you just want the main portion). As you can see below, in my case, /dev/sda matches up with: ata-Crucial_CT480M500SSD1_13440956798B, so in the lilo.conf file, I would change boot = /dev/sda to boot = /dev/disk/by-id/ata-Crucial_CT480M500SSD1_13440956798B.

Code:
jbhansen@craven-moorhead:~$ ls -la /dev/disk/by-id
total 0
drwxr-xr-x 2 root root 800 Dec 10 00:50 ./
drwxr-xr-x 8 root root 160 Dec  2 14:31 ../
lrwxrwxrwx 1 root root   9 Dec 10 00:47 ata-Crucial_CT480M500SSD1_13440956798B -> ../../sda
lrwxrwxrwx 1 root root  10 Dec  2 19:31 ata-Crucial_CT480M500SSD1_13440956798B-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Dec  2 19:31 ata-Crucial_CT480M500SSD1_13440956798B-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 Dec  2 19:31 ata-Crucial_CT480M500SSD1_13440956798B-part3 -> ../../sda3
Next, you will need to change the root entry for each kernel you have set up. Instead of root = /dev/sda2, it would be root = "UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d" (include the quotes). You can see a portion of my /etc/fstab below (I removed most of the commented lines to improve readability for me and I left in the previous references just commented out):

Code:
root@craven-moorhead:~# cat /etc/lilo.conf
# LILO configuration file

# Append any additional kernel parameters:
append=" vt.default_utf8=0 acpi_enforce_resources=lax"
#boot = /dev/sda
boot = /dev/disk/by-id/ata-Crucial_CT480M500SSD1_13440956798B
compact
LBA32

# Boot BMP Image.
  bitmap = /boot/slack.bmp
  bmp-colors = 255,0,255,0,255,0
  bmp-table = 60,6,1,16
  bmp-timer = 65,27,0,255

prompt
timeout = 12
change-rules
  reset
vga = 794

# Linux bootable partition config begins
image = /boot/vmlinuz-generic-3.18.24
  initrd = /boot/initrd-3.18.24.gz
#  /dev/sda2
  root = "UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d"
  label = Slack-3.18.24
  read-only
 
6 members found this post helpful.
Old 12-11-2015, 04:08 PM   #5
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
I'm not sure I understand what you want to do. If you want a separate /home partition, the easiest way to do that is during the installation. If you currently have /home under the / partition (sda2) that is where /home is. If you want to change sda4 to make it your /home partition you will need to move everything from under /home on sda2 to sda4 and format sda4 with a Linux filesystem. The problem with doing this is that is going to overwrite the data currently on sda4. Might be easier to shrink a partition and create a new /home partition.
 
Old 12-11-2015, 04:43 PM   #6
SiriD
LQ Newbie
 
Registered: Dec 2015
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
By default, Slackware will just use the drive mappings (/dev/sda2, /dev/sdb1, etc). UUIDs are not normally needed for most setups, and they can make it harder to understand what the fstab is doing for newer users.

But, there are definitely some setups where UUIDs are preferred (mine is one of them). UUIDs are unique to each partition and are generated every time you format the drive. If your mappings change when you plug in a thumbdrive, switch around hard drives, etc, then UUIDs are probably preferable to the drive mappings since they'll always point to the correct mapping, even if that has changed since your last reboot. They are also extremely handy to use for external devices (if you don't know if you're thumbdrive will be /dev/sdg or /dev/sdk since it changes all the time, you could reference it by its UUID). I switch my harddrives around a lot, and so it is much easier for me to just reference the UUID rather than try and remap all the mappings when they have changed.

If you want to switch to UUID in your fstab, you can easily do it by finding the corresponding UUID of the various mappings that are in there. Personally, I just use ls -la /dev/disk/by-uuid, but I know you can also use lsblk if you throw some arguments at it. You would just need to replace your "/dev/sda1" with "UUID=whatever-the-uuid-is" and leave the rest the same. Here's my fstab (I like everything to line up)

Code:
####### SSD ######
UUID=bc4538e5-9387-4e5c-877b-d15744acb6ce       swap                            swap            defaults,discard                0   0
UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d       /                               ext4            defaults,noatime,discard        0   1
UUID=226f1db3-2f14-4862-9998-8be1e8f7cdc9       /home                           ext4            defaults,noatime,discard        0   2

###### HD ######
UUID=cd554cf8-c346-4bd5-ba6a-84ac99af571f       /share/movies                   ext4            defaults                        0   2
UUID=cae38214-71f3-4678-bf78-3e836e7a4022       /share/TV/completed             ext4            defaults                        0   2
UUID=ebdab491-caf6-4ae7-9672-67ed3bb3d665       /share/TV/ongoing               ext4            defaults                        0   2
UUID=5f466dd0-2434-46ba-a276-6eee7647da9d       /share/music                    ext4            defaults                        0   2
UUID=2ef6e776-c2eb-4e56-bc7e-dfe083559d8f       /share/gothrough                ext4            defaults                        0   2
Now, if you have a reason other than preference to move your fstab to UUIDs, you should probably move your /etc/lilo.conf to UUIDs as well, because if the root drive changes, your kernel will panic on boot and you won't finish the boot process.

First, you'll need to change the boot drive to the disk ID (the drives themselves don't have UUIDs, only individual partitions, so if you don't want to reference it as /dev/sda, you'd need the disk's ID). To get the ID, you just check ls -la /dev/disk/by-id and match up the boot drive (you should see additional part1, part2, part3, etc for each partition on the drive, but you just want the main portion). As you can see below, in my case, /dev/sda matches up with: ata-Crucial_CT480M500SSD1_13440956798B, so in the lilo.conf file, I would change boot = /dev/sda to boot = /dev/disk/by-id/ata-Crucial_CT480M500SSD1_13440956798B.

Code:
jbhansen@craven-moorhead:~$ ls -la /dev/disk/by-id
total 0
drwxr-xr-x 2 root root 800 Dec 10 00:50 ./
drwxr-xr-x 8 root root 160 Dec  2 14:31 ../
lrwxrwxrwx 1 root root   9 Dec 10 00:47 ata-Crucial_CT480M500SSD1_13440956798B -> ../../sda
lrwxrwxrwx 1 root root  10 Dec  2 19:31 ata-Crucial_CT480M500SSD1_13440956798B-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Dec  2 19:31 ata-Crucial_CT480M500SSD1_13440956798B-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 Dec  2 19:31 ata-Crucial_CT480M500SSD1_13440956798B-part3 -> ../../sda3
Next, you will need to change the root entry for each kernel you have set up. Instead of root = /dev/sda2, it would be root = "UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d" (include the quotes). You can see a portion of my /etc/fstab below (I removed most of the commented lines to improve readability for me and I left in the previous references just commented out):

Code:
root@craven-moorhead:~# cat /etc/lilo.conf
# LILO configuration file

# Append any additional kernel parameters:
append=" vt.default_utf8=0 acpi_enforce_resources=lax"
#boot = /dev/sda
boot = /dev/disk/by-id/ata-Crucial_CT480M500SSD1_13440956798B
compact
LBA32

# Boot BMP Image.
  bitmap = /boot/slack.bmp
  bmp-colors = 255,0,255,0,255,0
  bmp-table = 60,6,1,16
  bmp-timer = 65,27,0,255

prompt
timeout = 12
change-rules
  reset
vga = 794

# Linux bootable partition config begins
image = /boot/vmlinuz-generic-3.18.24
  initrd = /boot/initrd-3.18.24.gz
#  /dev/sda2
  root = "UUID=23bce2c2-996d-449e-89cc-0e5029cc6d8d"
  label = Slack-3.18.24
  read-only
It work perfectly guy!! Thank you very much!! i replace /dev/sda4 for UUID="number" how you told me!

Last edited by SiriD; 12-11-2015 at 05:14 PM.
 
Old 12-11-2015, 04:44 PM   #7
SiriD
LQ Newbie
 
Registered: Dec 2015
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
I'm not sure I understand what you want to do. If you want a separate /home partition, the easiest way to do that is during the installation. If you currently have /home under the / partition (sda2) that is where /home is. If you want to change sda4 to make it your /home partition you will need to move everything from under /home on sda2 to sda4 and format sda4 with a Linux filesystem. The problem with doing this is that is going to overwrite the data currently on sda4. Might be easier to shrink a partition and create a new /home partition.
It probably could solve my problem, but i have a lot of data in that partition and i cannot make a backup of it, thats why i want to put it like my home in slackware, without modify the filesystem. now i have windows and linux using the same partition like home.
 
  


Reply



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
\vi/etc/fstab works fine . vi /etc/fstab throws bash command not found in Rescue mode jsaravana87 Linux - Server 1 05-13-2013 02:08 PM
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM
The fstab problem that should have been beebelo Ubuntu 10 11-03-2005 11:23 PM
fstab problem element Linux - Software 2 06-17-2003 01:06 PM

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

All times are GMT -5. The time now is 12:03 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