由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - scsi drive problem when resuming from suspend
相关主题
江湖救急,udev不能自动mount外置U盘再问个关于nas的问题
【求助】udev无法自动mount任何USB盘两个IDE硬盘怎么无缘无故的crash了呢?
一个恼人的mount问题问个mount的问题
不能umount /mnt了怎么回事阿?[已解决]请问如何在auto mount NTFS partition?
我来示范一下自动mount硬盘和读写权限换硬盘怎么把系统从旧硬盘转移到新的
请教一个mount NTFS partition的问题菜鸟求救:系统不能启动了
怎么自动mount一个USB设备?包子求助:ubuntu的grub找不到centos
问个文件系统的问题有几个分区不知道怎么挂载的。。。
相关话题的讨论汇总
话题: dev话题: home话题: scsi话题: device话题: suspend
进入Linux版参与讨论
1 (共1页)
m*********n
发帖数: 28
1
ubuntu 10.10.
when resuming from suspend, the scsi drive will be changed from /dev/sda to
/dev/sdg, thus the root which is mounted on /dev/sda1 is missing and the
system hangs.
i am using dev uuid in the fstab. i think when resuming and reload the file
system, the mtab is used, and mtab does not use uuid but device name. so
when the dev name get screwd, everything goes wrong.
right now the work around is i have to put the root in a sata drive, and
mount the /home on the scsi drive. after resumed, the sata drive's dev name stays the same so the system can resume, then i run mount -a to remount the /home onto /dev/sdg1. i tried to force umount /home but it says fs is busy
and refuse to umount it.
any idea how to fix it?
thx
v*****r
发帖数: 1119
2
用 udev,写一个 rule file 就行了

to
file
name stays the same so the system can resume, then i run mount -a to remount
the /home onto /dev/sdg1. i tried to force umount /home but it says fs is
busy

【在 m*********n 的大作中提到】
: ubuntu 10.10.
: when resuming from suspend, the scsi drive will be changed from /dev/sda to
: /dev/sdg, thus the root which is mounted on /dev/sda1 is missing and the
: system hangs.
: i am using dev uuid in the fstab. i think when resuming and reload the file
: system, the mtab is used, and mtab does not use uuid but device name. so
: when the dev name get screwd, everything goes wrong.
: right now the work around is i have to put the root in a sata drive, and
: mount the /home on the scsi drive. after resumed, the sata drive's dev name stays the same so the system can resume, then i run mount -a to remount the /home onto /dev/sdg1. i tried to force umount /home but it says fs is busy
: and refuse to umount it.

m*********n
发帖数: 28
3
cool. let me try, i think it should work. will report back.

remount

【在 v*****r 的大作中提到】
: 用 udev,写一个 rule file 就行了
:
: to
: file
: name stays the same so the system can resume, then i run mount -a to remount
: the /home onto /dev/sdg1. i tried to force umount /home but it says fs is
: busy

m*********n
发帖数: 28
4
hmmm, still not working.
i was able to use the udev rules to create a stable node /dev/raid-part-1
for the partition. Use uuid in fstab, i can see the home is mounted on /dev/
raid-part-1.
After resume, a new dev node /dev/sdg1 is created, /dev/raid-part-1 is still
there, df showed /home was still mounted on /dev/raid-part-1. Yet the /home
is not accessible. i tried to remount the /home on /dev/raid-part-1, but
after remount home is still not accessible.
the only way to get /home back is to mount -a. then /home is mounted on /dev
/sdg1. i have to restart gnome-panel too, otherwise it complains something
about can't access to stuff in home. after these hassle, i can suspend/
resume as many times as i like, no more problem.
i noticed a new entry $HOME/.gvfs is mounted on gvfs-fuse-daemon in df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdg1 1898789800 805524052 996809764 45% /home
gvfs-fuse-daemon 1898789800 805524052 996809764 45% $HOME/.gvfs
/dev/raid-part-1 1898789800 805524052 996809764 45% /home
i am wonder if this gvfs is cause problem...
i tried to unload the raid controller's kernel module at the begining of the
sleep hook chain, not difference...

【在 m*********n 的大作中提到】
: cool. let me try, i think it should work. will report back.
:
: remount

v*****r
发帖数: 1119
5
interesting, have you tired use new name instead of UUID in fstab?

dev/
still
home
dev

【在 m*********n 的大作中提到】
: hmmm, still not working.
: i was able to use the udev rules to create a stable node /dev/raid-part-1
: for the partition. Use uuid in fstab, i can see the home is mounted on /dev/
: raid-part-1.
: After resume, a new dev node /dev/sdg1 is created, /dev/raid-part-1 is still
: there, df showed /home was still mounted on /dev/raid-part-1. Yet the /home
: is not accessible. i tried to remount the /home on /dev/raid-part-1, but
: after remount home is still not accessible.
: the only way to get /home back is to mount -a. then /home is mounted on /dev
: /sdg1. i have to restart gnome-panel too, otherwise it complains something

m*********n
发帖数: 28
6
yep i tried it. not working either. i also tried to unbind the device in the
/sys, no help either.
i noticed, if i don't login as any user, meaning no process is accessing the
/home, i can resume w/o problem. the /home is mounted on my given device
name after resume.
this is really puzzling me. will try keep the raid controller kernel module
during suspend. that's the last thing i can think of.

【在 v*****r 的大作中提到】
: interesting, have you tired use new name instead of UUID in fstab?
:
: dev/
: still
: home
: dev

m*********n
发帖数: 28
7
ok i found a way to work around this problem now.
after resume, do the following steps:
1. unbind the raid controller device:
echo -n "1:0:0:0" | tee /sys/bus/scsi/drivers/sd/unbind
you can get the device's pci number 1:0:0:0 from /sys/device/... there are
other ways to do it. forgot how i got it already... :-|
and sd in scsi/drivers/sd stands for sd*, the harddrive device
this step is to make the clear out the busy flag(?not sure if this is true)
on device /dev/sda1
2. bid the raid controller again
echo -n "1:0:0:0" | tee /sys/bus/scsi/drivers/sd/bind
rebind the device so the udevd in the next step can find the device and
recreate the device node for it.
3. make the udev to recreate the device nodes. after the step, the /dev/sda1
appeared again.
udevadmin trigger
i write a udev rule file to explicitly make the node name sda1, not sure if it's needed or not.
4. now you can mount the filesystem
mount -a
and the /home which is on /dev/sda1 before suspend and is on /dev/sdh1 after
resume now is back to /dev/sda1 again, and there's no more /dev/sdh1
now you can access /home w/o problem. almost everything works, except there
are some warnings about some inodes in /home in the kernel log. but that's
fine. it doesn't cause any real problem so far.
so the key points is to unbind and bind the device so all the flags on the
device are flushed. only after this can you work on the node and filesystem.
interesting enough, after i did the procedures the first time i resume from
suspend, there's no need for the steps in the following suspend/resume
cycles.
1 (共1页)
进入Linux版参与讨论
相关主题
有几个分区不知道怎么挂载的。。。我来示范一下自动mount硬盘和读写权限
Access_Control_Lists请教一个mount NTFS partition的问题
请教VM中Ubuntu 12.04 LTS增大硬盘容量的正确步骤怎么自动mount一个USB设备?
偶也请教一个linux下vm的问题问个文件系统的问题
江湖救急,udev不能自动mount外置U盘再问个关于nas的问题
【求助】udev无法自动mount任何USB盘两个IDE硬盘怎么无缘无故的crash了呢?
一个恼人的mount问题问个mount的问题
不能umount /mnt了怎么回事阿?[已解决]请问如何在auto mount NTFS partition?
相关话题的讨论汇总
话题: dev话题: home话题: scsi话题: device话题: suspend