[SOLVED] Separate partitions mistakenly mounted inside of /
SlackwareThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Separate partitions mistakenly mounted inside of /
(Not sure if this is the best place to post this, but I'm running Salix 13.37 which is essentially Slackware 13.37 with some additional graphical tools, so posted it here. Mods, please move if necessary.)
For some reason, my separate /data and /music partitions have been created as directories inside of / .
/dev/sda1 = / with 10.7 GB. It's a primary, bootable partition. It should have a lot of empty space but is full.
Separate partitions (extended, logical):
/dev/sda5 = /data with 5 GB. For my personal files, instead of using /home.
/dev/sda6 = /music. Should be 94 GB. For music and videos.
Somehow both of these partitions have been mounted INSIDE of /, causing / to become totally full.
/music got allotted 6 GB inside of / ; it is completely filled up.
When I try to mount the partition /dev/sda6 I get the error:
Failed to mount "94G Volume".
mount: wrong fs type, bad option, bad superblock on /dev/sda6,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
dmsg showed the following error from bootup, so I just removed the "discard" option from the line for /dev/sda6:
Code:
XFS: unknown mount option [discard]
How do I get the system to see and automount /data and /music as separate partitions outside of / ?
not sure why all the options on yours... guess first question is, is music really xfs, etc. maybe try taking some or all of those options off the fstab mount points.
I'd also just try mounting manually to see what errors or warnings show up.
man mount
and follow the directions to see if somehow, something just got partitioned wrong.
oh, just a followup note... be sure you get everything out of /music, etc to a nice safe place as the folder should be empty before you mount the other partition on it... just a thought.
(here's hoping eventually... Salix goes away..)
Last edited by WhiteWolf1776; 07-18-2013 at 01:21 PM.
Reason: warning about moving files from music, etc.
I guess you copied some data to /music or /data while they were not mounted at all. At least judging from the error messages.
Right now your 2 extra partitions get mounted to their exclusive directories which are normaly not used by a linux system. So I'm not quite sure what you mean with mounting them outside of /. Maybe mount them within your /home/username/ directory?
To have them automount just edit the /etc/fstab and remove the user option or add the auto option. That should take care of them beeing mounted on boot (without user option) or when you login (auto option).
But before all first get the entries in /etc/fstab correct. So edit the file then do a mount /mount/point/of/partition. And then make sure everything worked out with mount and see where it got mounted.
Wait, are the files that should be on the music and data partitions actually visible/present within the root partition?
Could you post the output of
fdisk -l
and
df -h
Here's the output from fdisk -l and df -h"
Code:
# fdisk -l
Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000ad3d
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 24578219 12288086 83 Linux
/dev/sda2 24580096 49156095 12288000 83 Linux
/dev/sda3 49162238 250068991 100453377 5 Extended
/dev/sda5 49162240 59402239 5120000 83 Linux
/dev/sda6 59404288 243724287 92160000 83 Linux
/dev/sda7 243728384 250068991 3170304 82 Linux swap
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 12G 11G 750M 94% /
/dev/sda5 4.9G 138M 4.5G 3% /data
/dev/sda6 88G 33M 88G 1% /music
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 1000M 4.0K 1000M 1% /tmp
To clarify, there is nothing in /dev/sda5 /data or in /dev/sda6 /music. /data and /music are (wrongly) mounted in the / filesystem in /dev/sda1.
I don't put documents or data into my /home/tigerflag directory. I use separate partitions flike /data and /music instead, so in a dual-boot setup all my files are accessible from any distro.
If I were to put my docs and music into a partition called /home/tigerflag, then share that partition between distros, different distros's configuration settings would cause problems.
Edit:
forgot to mention, the mount --move assumes kernel 2.5.1 or greater
Code:
The move operation.
Since Linux 2.5.1 it is possible to atomically move a mounted tree to another place. The call is
mount --move olddir newdir
or shortoption
mount -M olddir newdir
This will cause the contents which previously appeared under olddir to be accessed under newdir. The physical location of the files is not changed. Note that the olddir has to be a
mountpoint.
Using kernel 2.6.37 so this should work, but got these error messages:
Code:
# for i in data music;do
> mkdir /mnt/$i
> mount --move /$i /mnt/$i
> done
mkdir: cannot create directory `/mnt/data': File exists
mount: wrong fs type, bad option, bad superblock on /data,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
mkdir: cannot create directory `/mnt/music': File exists
mount: wrong fs type, bad option, bad superblock on /music,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Using kernel 2.6.37 so this should work, but got these error messages:
Code:
# for i in data music;do
> mkdir /mnt/$i
> mount --move /$i /mnt/$i
> done
mkdir: cannot create directory `/mnt/data': File exists
mount: wrong fs type, bad option, bad superblock on /data,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
mkdir: cannot create directory `/mnt/music': File exists
mount: wrong fs type, bad option, bad superblock on /music,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
guess I should have checked before mkdir, still that is none fatal error..
Ok,
Code:
umount /{data,music}
edit /etc/fstab, ( so it is /mnt/data and /mnt/music )
and then mount
Okay using partitions throughout distribtutions is a total other ballpark then just mounting them in one. I'd say it does not really matter where they get mounted but more how the uid and gid of the filesystem gets translated by the active system. For an example
Now as the filesystem only has the numbers stored with the file you'll get into trouble writing to existing files when hoping distributions. Solution for me would be either to:
make __absolutly__ sure that the uid and gids are the same for the user.
Use some udev rules to chown stuff
or use acl.
With acl you also get into this uid, gid number thing but for every distribution you just add another acl with the system specific id and should be fine. Taking that double appearing numbers are just silently ignored by acl or you ignore the message about dublicate entries.
As i wrote this you moved on. Just one edition. Please first make sure that the mount is functioning. Get to know the filesystem of the partition and make your head up where you want the partitons to be mounted (even if its just for now.) The mountpoint can be easily changed.
OK, I'm getting confused. Not sure who is talking to whom. The reason why I use Salix instead of straight Slackware is because I am commandline challenged. It's not from lack of trying to learn. I need instructions to be a little more step-by-step if it's not too much trouble...
Quote:
Actually, before you do that...
What is in /mnt/data and /mnt/music ?
You might like to move those files into /data and /music first
In /mnt/data there is only an empty lost+found directory, because it's formatted ext4.
In /mnt/music (formatted XFS) there is absolutely nothing.
OK, I'm getting confused. Not sure who is talking to whom. The reason why I use Salix instead of straight Slackware is because I am commandline challenged. It's not from lack of trying to learn. I need instructions to be a little more step-by-step if it's not too much trouble...
We are here brother. Good choice for using the shell (command line). Grants knowledge.
Quote:
Originally Posted by tigerflag
In /mnt/data there is only an empty lost+found directory, because it's formatted ext4.
In /mnt/music (formatted XFS) there is absolutely nothing.
Okay so now we can forget about the filesystem mounted there (Beside music having some stuff i it. *edit*). Just need to get sorted if after you unmount them they contain data. See if you mount things on a specific directory everything that was there before is masked. It does not show up. I'm saying this cause you said that the / partiton had a lot of free space. But more on this later.
Firerat, when you say:
can you please elaborate and tell me exactly how to write that line?
file -s is enough we know now that its formated with an ext4 filesystem. Enough for getting the mount line going. Please post output of file -s for /dev/sda6. (For tune2fs -l should list infos about the filesystem. check man tune2fs.)
Okay lets do this.
Unmount /dev/sda5 and /dev/sda6. So we get a clean system only file hierachy.
After that do that du -hcs from firerat on /data and /music. We now see if they actually contain data that is saved inside the / partition|filesystem. (The masking I talked about earlier). Or just ls on those dirs.
Lets just get that going before I toss some more at you.
root[tigerflag]# umount /dev/sda5
root[tigerflag]# umount /dev/sda6
root[tigerflag]# du -hcs /data
4.0K /data
4.0K total
root[tigerflag]# du -hcs /music
5.8G /music
5.8G total
PS- the 4K file in /data was just a test file. No loss if it gets lost. I can even afford to lose all the music in /music- it's easy enough to replace in the proper sda6 /music directory if necessary.
but / containing 5.8G of music is almost completely full.
Last edited by tigerflag; 07-18-2013 at 04:24 PM.
Reason: added PS
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.